Skip to content

Commit

Permalink
feat: upgrade dt-sql-parser to v4.0.0-beta.4.11
Browse files Browse the repository at this point in the history
  • Loading branch information
HaydenOrz committed Jan 4, 2024
1 parent 0a64586 commit 4d680f4
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 22 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
}
},
"dependencies": {
"dt-sql-parser": "4.0.0-beta.4.9"
"dt-sql-parser": "4.0.0-beta.4.11"
},
"peerDependencies": {
"monaco-editor": ">=0.31.0"
Expand Down
8 changes: 4 additions & 4 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 7 additions & 13 deletions src/languageFeatures.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,29 +113,23 @@ export class DiagnosticsAdapter<T extends IWorker> {
}
}

function toSeverity(lsSeverity: number): MarkerSeverity {
function toSeverity(lsSeverity?: number): MarkerSeverity {
switch (lsSeverity) {
default:
return MarkerSeverity.Error;
}
}

/**
* TODO: diag is actually a type ParseError
* @see {@link ParseError}
*/
function toDiagnostics(resource: Uri, diag: any): editor.IMarkerData {
let code = typeof diag.code === 'number' ? String(diag.code) : <string>diag.code;

function toDiagnostics(resource: Uri, diag: ParseError): editor.IMarkerData {
return {
severity: toSeverity(diag.severity),
severity: toSeverity(),
startLineNumber: diag.startLine,
startColumn: diag.startCol + 1,
startColumn: diag.startColumn,
endLineNumber: diag.endLine,
endColumn: diag.endCol + 1,
endColumn: diag.endColumn,
message: diag.message,
code: code,
source: diag.source
code: undefined, // TODO: set error type
source: 'dt-sql-parser'
};
}

Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -985,10 +985,10 @@ dotgitignore@^2.1.0:
find-up "^3.0.0"
minimatch "^3.0.4"

[email protected].9:
version "4.0.0-beta.4.9"
resolved "https://registry.npmmirror.com/dt-sql-parser/-/dt-sql-parser-4.0.0-beta.4.9.tgz#0f2fc382829f6ad9bbbd7d8ac6a6ceb33336f466"
integrity sha512-c0mStI57Hq+15XRKuwZ7YZ+4C3Z+mO+nJ/wdws6PndBTjVF55mlbHVbRuBGDjlCFSpeN+VqEY/d2VZC4q1oMpQ==
[email protected].11:
version "4.0.0-beta.4.11"
resolved "https://registry.npmmirror.com/dt-sql-parser/-/dt-sql-parser-4.0.0-beta.4.11.tgz#2119847717f3ec6a462a418425db1b92e8a5f1a8"
integrity sha512-bgMJAMImikNwE0OPZApI+R+PjpI8xoJAksQIUJdtS4+piZII1LHzbmlp8T7iRJ4Fo56EwY5ILmv9VcZ/PwKV1A==
dependencies:
antlr4-c3 "3.1.1"
antlr4ts "0.5.0-alpha.4"
Expand Down

0 comments on commit 4d680f4

Please sign in to comment.