File tree Expand file tree Collapse file tree 6 files changed +24
-24
lines changed Expand file tree Collapse file tree 6 files changed +24
-24
lines changed Original file line number Diff line number Diff line change 11import * as monaco from 'monaco-editor'
22
33const fixedPositions = [ 0 , 6 , 7 , 11 ]
4- const lastFixedPosition = fixedPositions [ fixedPositions . length - 1 ]
4+ const lastFixedPosition = fixedPositions [ fixedPositions . length - 1 ] !
55
66function getIndentWidth ( editor : monaco . editor . IStandaloneCodeEditor ) : number {
77 return editor . getModel ( ) ! . getOptions ( ) . tabSize
Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ const registry = monaco.extra.Registry.as<monaco.extra.IJSONContributionRegistry
77// Hack because the commands are filled by a code not run in monaco-editor
88{
99 const allCommands = monaco . extra . CommandsRegistry . getCommands ( )
10- const keybindingsCommandSchema = ( registry . getSchemaContributions ( ) . schemas [ 'vscode://schemas/keybindings' ] ! . items as monaco . extra . IJSONSchema ) . properties ! . command . anyOf ! [ 0 ] !
10+ const keybindingsCommandSchema = ( registry . getSchemaContributions ( ) . schemas [ 'vscode://schemas/keybindings' ] ! . items as monaco . extra . IJSONSchema ) . properties ! . command ! . anyOf ! [ 0 ] !
1111 keybindingsCommandSchema . enum = Array . from ( allCommands . keys ( ) )
1212 keybindingsCommandSchema . enumDescriptions = < string [ ] > Array . from ( allCommands . values ( ) ) . map ( command => command . description ?. description )
1313}
Original file line number Diff line number Diff line change @@ -73,9 +73,9 @@ function parseLanguageConfiguration (config: RawLanguageConfiguration): monaco.e
7373 ...config ,
7474 folding : config . folding != null
7575 ? {
76- ...config . folding ,
77- markers : ( markers != null ) ? { start : new RegExp ( markers . start ) , end : new RegExp ( markers . end ) } : undefined
78- }
76+ ...config . folding ,
77+ markers : ( markers != null ) ? { start : new RegExp ( markers . start ) , end : new RegExp ( markers . end ) } : undefined
78+ }
7979 : undefined
8080 }
8181}
Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ for (const contribution of extensions.semanticTokenModifiers as ITokenModifierEx
2929
3030for ( const contribution of extensions . semanticTokenScopes as unknown as ITokenStyleDefaultExtensionPoint [ ] ) {
3131 for ( const selectorString in contribution . scopes ) {
32- const tmScopes = contribution . scopes [ selectorString ]
32+ const tmScopes = contribution . scopes [ selectorString ] !
3333 const selector = tokenClassificationRegistry . parseTokenSelector ( selectorString , contribution . language )
3434 tokenClassificationRegistry . registerTokenStyleDefault ( selector , { scopesToProbe : tmScopes . map ( s => s . split ( ' ' ) ) } )
3535 }
Original file line number Diff line number Diff line change @@ -159,22 +159,22 @@ export function hideCodeWithoutDecoration (editor: monaco.editor.IStandaloneCode
159159 . sort ( ( a , b ) => a . startLineNumber - b . startLineNumber )
160160 // merge ranges
161161 . reduce < monaco . Range [ ] > ( ( acc , range ) => {
162- if ( acc . length === 0 ) {
163- return [ range ]
164- }
165- const lastRange = acc [ acc . length - 1 ]
166- if ( range . getStartPosition ( ) . isBeforeOrEqual ( lastRange . getEndPosition ( ) ) ) {
167- return [
168- ...acc . slice ( 0 , - 1 ) ,
169- monaco . Range . fromPositions ( lastRange . getStartPosition ( ) , range . getEndPosition ( ) )
170- ]
171- } else {
172- return [
173- ...acc ,
174- range
175- ]
176- }
177- } , [ ] )
162+ if ( acc . length === 0 ) {
163+ return [ range ]
164+ }
165+ const lastRange = acc [ acc . length - 1 ] !
166+ if ( range . getStartPosition ( ) . isBeforeOrEqual ( lastRange . getEndPosition ( ) ) ) {
167+ return [
168+ ...acc . slice ( 0 , - 1 ) ,
169+ monaco . Range . fromPositions ( lastRange . getStartPosition ( ) , range . getEndPosition ( ) )
170+ ]
171+ } else {
172+ return [
173+ ...acc ,
174+ range
175+ ]
176+ }
177+ } , [ ] )
178178
179179 let hiddenAreas : monaco . IRange [ ] = [ ...otherHiddenAreas ]
180180 let position = new monaco . Position ( 1 , 1 )
Original file line number Diff line number Diff line change @@ -369,7 +369,7 @@ async function createRepositoryFileResolver (extension: Extension) {
369369 const from = parsed [ key ] . path
370370 const githubOrigin = / h t t p s : \/ \/ g i t h u b \. c o m \/ ( .* ) / . exec ( parsed [ key ] . url )
371371 if ( githubOrigin != null ) {
372- map [ from ] = githubOrigin [ 1 ]
372+ map [ from ] = githubOrigin [ 1 ] !
373373 }
374374 }
375375 }
@@ -382,7 +382,7 @@ async function createRepositoryFileResolver (extension: Extension) {
382382 let rpath = `${ extension . path ?? '' } ${ fixedPath } `
383383 let version = extension . version ?? 'master'
384384 for ( const from in map ) {
385- const to = map [ from ]
385+ const to = map [ from ] !
386386 if ( rpath . startsWith ( from ) ) {
387387 repository = to
388388 rpath = path . relative ( from , rpath )
You can’t perform that action at this time.
0 commit comments