Skip to content

Commit 801aeaf

Browse files
Merge pull request #232 from intersystems-community/local-csp-compile-error
skip compilation for local CSP files, yet, for now
2 parents 6dd0ead + 42f5b42 commit 801aeaf

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/utils/index.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,17 +43,21 @@ export function currentFile(document?: vscode.TextDocument): CurrentFile {
4343
if (!document) {
4444
return null;
4545
}
46+
const fileName = document.fileName;
47+
const fileExt = fileName.split(".").pop().toLowerCase();
4648
if (
4749
!schemas.includes(document.uri.scheme) &&
48-
(!document || !document.fileName || !document.languageId || !document.languageId.startsWith("objectscript"))
50+
(!document ||
51+
!document.fileName ||
52+
!document.languageId ||
53+
!document.languageId.startsWith("objectscript") ||
54+
fileExt.match(/(csp)/i)) // Skip CSP for now, yet
4955
) {
5056
return null;
5157
}
5258
const eol = document.eol || vscode.EndOfLine.LF;
5359
const uri = document.uri;
54-
const fileName = document.fileName;
5560
const content = document.getText();
56-
const fileExt = fileName.split(".").pop().toLowerCase();
5761
let name = "";
5862
let ext = "";
5963
const { query } = url.parse(decodeURIComponent(uri.toString()), true);

0 commit comments

Comments
 (0)