@@ -105,15 +105,15 @@ export class JsonServer {
105105
106106 protected getFoldingRanges ( params : FoldingRangeParams ) : FoldingRange [ ] {
107107 const document = this . documents . get ( params . textDocument . uri ) ;
108- if ( ! document ) {
108+ if ( document === undefined ) {
109109 return [ ] ;
110110 }
111111 return this . jsonService . getFoldingRanges ( document ) ;
112112 }
113113
114114 protected findDocumentColors ( params : DocumentColorParams ) : Thenable < ColorInformation [ ] > {
115115 const document = this . documents . get ( params . textDocument . uri ) ;
116- if ( ! document ) {
116+ if ( document === undefined ) {
117117 return Promise . resolve ( [ ] ) ;
118118 }
119119 const jsonDocument = this . getJSONDocument ( document ) ;
@@ -122,7 +122,7 @@ export class JsonServer {
122122
123123 protected getColorPresentations ( params : ColorPresentationParams ) : ColorPresentation [ ] {
124124 const document = this . documents . get ( params . textDocument . uri ) ;
125- if ( ! document ) {
125+ if ( document === undefined ) {
126126 return [ ] ;
127127 }
128128 const jsonDocument = this . getJSONDocument ( document ) ;
@@ -131,7 +131,7 @@ export class JsonServer {
131131
132132 protected codeAction ( params : CodeActionParams ) : Command [ ] {
133133 const document = this . documents . get ( params . textDocument . uri ) ;
134- if ( ! document ) {
134+ if ( document === undefined ) {
135135 return [ ] ;
136136 }
137137 return [ {
@@ -147,12 +147,12 @@ export class JsonServer {
147147
148148 protected format ( params : DocumentRangeFormattingParams ) : TextEdit [ ] {
149149 const document = this . documents . get ( params . textDocument . uri ) ;
150- return document ? this . jsonService . format ( document , params . range , params . options ) : [ ] ;
150+ return document === undefined ? [ ] : this . jsonService . format ( document , params . range , params . options ) ;
151151 }
152152
153153 protected findDocumentSymbols ( params : DocumentSymbolParams ) : SymbolInformation [ ] {
154154 const document = this . documents . get ( params . textDocument . uri ) ;
155- if ( ! document ) {
155+ if ( document === undefined ) {
156156 return [ ] ;
157157 }
158158 const jsonDocument = this . getJSONDocument ( document ) ;
@@ -161,10 +161,10 @@ export class JsonServer {
161161
162162 // oxlint-disable-next-line @typescript-eslint/no-explicit-any
163163 protected async executeCommand ( params : ExecuteCommandParams ) : Promise < any > {
164- if ( params . command === 'json.documentUpper' && params . arguments ) {
164+ if ( params . command === 'json.documentUpper' && params . arguments !== undefined ) {
165165 const versionedTextDocumentIdentifier = params . arguments [ 0 ] ;
166166 const document = this . documents . get ( versionedTextDocumentIdentifier . uri ) ;
167- if ( document ) {
167+ if ( document !== undefined ) {
168168 await this . connection . workspace . applyEdit ( {
169169 documentChanges : [ {
170170 textDocument : versionedTextDocumentIdentifier ,
@@ -183,7 +183,7 @@ export class JsonServer {
183183
184184 protected hover ( params : TextDocumentPositionParams ) : Thenable < Hover | null > {
185185 const document = this . documents . get ( params . textDocument . uri ) ;
186- if ( ! document ) {
186+ if ( document === undefined ) {
187187 return Promise . resolve ( null ) ;
188188 }
189189 const jsonDocument = this . getJSONDocument ( document ) ;
@@ -227,7 +227,7 @@ export class JsonServer {
227227
228228 protected completion ( params : TextDocumentPositionParams ) : Thenable < CompletionList | null > {
229229 const document = this . documents . get ( params . textDocument . uri ) ;
230- if ( ! document ) {
230+ if ( document === undefined ) {
231231 return Promise . resolve ( null ) ;
232232 }
233233 const jsonDocument = this . getJSONDocument ( document ) ;
0 commit comments