@@ -39,11 +39,13 @@ class Plugin implements ts.server.PluginModule {
3939 if ( ! pluginSettings ) {
4040 return false ;
4141 }
42- const enable = pluginSettings . enableSettingsUnscoped . enable ;
43- if ( enable != null ) {
44- return enable ;
42+ const enableSettingsUnscoped = pluginSettings . enableSettingsUnscoped ??
43+ { enable : null , enablePaths : null , disablePaths : [ ] } ;
44+ const scopesWithDenoJson = pluginSettings . scopesWithDenoJson ?? [ ] ;
45+ if ( enableSettingsUnscoped . enable != null ) {
46+ return enableSettingsUnscoped . enable ;
4547 }
46- return pluginSettings . scopesWithDenoJson . length != 0 ;
48+ return scopesWithDenoJson . length != 0 ;
4749 }
4850
4951 // determines if a specific filename is Deno enabled or not.
@@ -56,9 +58,11 @@ class Plugin implements ts.server.PluginModule {
5658 return false ;
5759 }
5860 const enableSettings =
59- pluginSettings . enableSettingsByFolder . find ( ( [ workspace , _ ] ) =>
61+ pluginSettings . enableSettingsByFolder ? .find ( ( [ workspace , _ ] ) =>
6062 pathStartsWith ( fileName , workspace )
61- ) ?. [ 1 ] ?? pluginSettings . enableSettingsUnscoped ;
63+ ) ?. [ 1 ] ?? pluginSettings . enableSettingsUnscoped ??
64+ { enable : null , enablePaths : null , disablePaths : [ ] } ;
65+ const scopesWithDenoJson = pluginSettings . scopesWithDenoJson ?? [ ] ;
6266 for ( const path of enableSettings . disablePaths ) {
6367 if ( pathStartsWith ( fileName , path ) ) {
6468 return false ;
@@ -72,9 +76,7 @@ class Plugin implements ts.server.PluginModule {
7276 if ( enableSettings . enable != null ) {
7377 return enableSettings . enable ;
7478 }
75- return pluginSettings . scopesWithDenoJson . some ( ( scope ) =>
76- pathStartsWith ( fileName , scope )
77- ) ;
79+ return scopesWithDenoJson . some ( ( scope ) => pathStartsWith ( fileName , scope ) ) ;
7880 }
7981
8082 #log = ( ..._msgs : unknown [ ] ) => { } ;
0 commit comments