File tree 3 files changed +3
-46
lines changed
3 files changed +3
-46
lines changed Original file line number Diff line number Diff line change @@ -62,31 +62,13 @@ describe('analyze', () => {
62
62
expect ( loggerWarn ) . not . toHaveBeenCalled ( )
63
63
} )
64
64
65
- it ( 'parses files with a missing nodes and return relevant diagnostics ' , async ( ) => {
65
+ it ( 'parses files with a missing nodes' , async ( ) => {
66
66
const analyzer = await getAnalyzer ( { } )
67
67
const diagnostics = analyzer . analyze ( {
68
68
uri : CURRENT_URI ,
69
69
document : FIXTURE_DOCUMENT . MISSING_NODE ,
70
70
} )
71
- expect ( diagnostics ) . toMatchInlineSnapshot ( `
72
- [
73
- {
74
- "message": "Syntax error: "fi" missing",
75
- "range": {
76
- "end": {
77
- "character": 0,
78
- "line": 12,
79
- },
80
- "start": {
81
- "character": 0,
82
- "line": 12,
83
- },
84
- },
85
- "severity": 2,
86
- "source": "bash-language-server",
87
- },
88
- ]
89
- ` )
71
+ expect ( diagnostics ) . toEqual ( [ ] )
90
72
expect ( loggerWarn ) . toHaveBeenCalledWith (
91
73
'Error while parsing dummy-uri.sh: syntax error' ,
92
74
)
Original file line number Diff line number Diff line change @@ -116,11 +116,7 @@ export default class Analyzer {
116
116
logger . warn ( `Error while parsing ${ uri } : syntax error` )
117
117
}
118
118
119
- const missingNodesDiagnostics = TreeSitterUtil . getDiagnosticsForMissingNodes (
120
- tree . rootNode ,
121
- )
122
-
123
- return diagnostics . concat ( missingNodesDiagnostics )
119
+ return diagnostics
124
120
}
125
121
126
122
/**
Original file line number Diff line number Diff line change @@ -56,24 +56,3 @@ export function findParent(
56
56
}
57
57
return null
58
58
}
59
-
60
- export function getDiagnosticsForMissingNodes ( node : SyntaxNode ) {
61
- const diagnostics : Diagnostic [ ] = [ ]
62
-
63
- forEach ( node , ( node ) => {
64
- if ( node . isMissing ( ) ) {
65
- diagnostics . push (
66
- Diagnostic . create (
67
- range ( node ) ,
68
- `Syntax error: "${ node . type } " missing` ,
69
- DiagnosticSeverity . Warning ,
70
- undefined ,
71
- 'bash-language-server' ,
72
- ) ,
73
- )
74
- }
75
- return node . hasError ( )
76
- } )
77
-
78
- return diagnostics
79
- }
You can’t perform that action at this time.
0 commit comments