File tree Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change 418418 }
419419 }
420420 }
421+ },
422+ "rubyLsp.erbSupport" : {
423+ "description" : " Enable ERB support. This can only work with server versions v0.17.5 or above" ,
424+ "type" : " boolean" ,
425+ "default" : true
421426 }
422427 }
423428 },
Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ import {
2121 ErrorAction ,
2222 CloseAction ,
2323 State ,
24+ DocumentFilter ,
2425} from "vscode-languageclient/node" ;
2526
2627import {
@@ -119,7 +120,7 @@ function collectClientOptions(
119120 const enabledFeatures = Object . keys ( features ) . filter ( ( key ) => features [ key ] ) ;
120121
121122 const fsPath = workspaceFolder . uri . fsPath . replace ( / \/ $ / , "" ) ;
122- const documentSelector : DocumentSelector = SUPPORTED_LANGUAGE_IDS . map (
123+ let documentSelector : DocumentSelector = SUPPORTED_LANGUAGE_IDS . map (
123124 ( language ) => {
124125 return { language, pattern : `${ fsPath } /**/*` } ;
125126 } ,
@@ -158,6 +159,14 @@ function collectClientOptions(
158159 } ) ;
159160 }
160161
162+ // This is a temporary solution as an escape hatch for users who cannot upgrade the `ruby-lsp` gem to a version that
163+ // supports ERB
164+ if ( ! configuration . get < boolean > ( "erbSupport" ) ) {
165+ documentSelector = documentSelector . filter ( ( selector ) => {
166+ return ( selector as DocumentFilter ) . language !== "erb" ;
167+ } ) ;
168+ }
169+
161170 return {
162171 documentSelector,
163172 workspaceFolder,
You can’t perform that action at this time.
0 commit comments