Skip to content

Commit 851c4b1

Browse files
committed
feat: 增加配置
1 parent dbfd496 commit 851c4b1

File tree

2 files changed

+31
-31
lines changed

2 files changed

+31
-31
lines changed

src/config.rs

Lines changed: 25 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -185,28 +185,26 @@ struct ServerInitializationOptions {
185185
}
186186
pub fn get_main_language_feature() -> LanguageFeatures {
187187
LanguageFeatures {
188-
references: Some(true),
188+
references: None,
189189
// 不存在
190-
implementation: Some(true),
191-
definition: Some(true),
192-
typeDefinition: Some(true),
193-
callHierarchy: Some(true),
194-
hover: Some(true),
195-
rename: Some(true),
196-
renameFileRefactoring: Some(true),
197-
signatureHelp: Some(true),
198-
codeAction: Some(true),
199-
workspaceSymbol: Some(true),
190+
implementation: None,
191+
definition: None,
192+
typeDefinition: None,
193+
callHierarchy: None,
194+
hover: None,
195+
rename: None,
196+
renameFileRefactoring: None,
197+
signatureHelp: None,
198+
codeAction: None,
199+
workspaceSymbol: None,
200200
completion: Some(Completion {
201201
defaultTagNameCase: DefaultTagNameCase::both,
202202
defaultAttrNameCase: DefaultAttrNameCase::kebabCase,
203203
getDocumentNameCasesRequest: Some(false),
204204
getDocumentSelectionRequest: Some(false),
205205
ignoreTriggerCharacters: None,
206206
}),
207-
schemaRequestService: Some(SchemaRequestService {
208-
getDocumentContentRequest: Some(true),
209-
}),
207+
schemaRequestService: None,
210208
documentHighlight: None,
211209
documentLink: None,
212210
codeLens: None,
@@ -218,18 +216,14 @@ pub fn get_main_language_feature() -> LanguageFeatures {
218216

219217
pub fn get_second_language_feature() -> LanguageFeatures {
220218
LanguageFeatures {
221-
documentHighlight: Some(true),
222-
documentLink: Some(true),
223-
codeLens: Some(CodeLens {
224-
showReferencesNotification: Some(true),
225-
}),
226-
semanticTokens: Some(false),
219+
documentHighlight: None,
220+
documentLink: None,
221+
codeLens: None,
222+
semanticTokens: None,
227223
// 不存在
228224
inlayHints: None,
229-
diagnostics: Some(true),
230-
schemaRequestService: Some(SchemaRequestService {
231-
getDocumentContentRequest: Some(true),
232-
}),
225+
diagnostics: None,
226+
schemaRequestService: None,
233227
references: None,
234228
implementation: None,
235229
definition: None,
@@ -255,11 +249,11 @@ pub fn get_doc_feature() -> DocumentFeatures {
255249
// "typescriptreact".to_owned(),
256250
// ],
257251
allowedLanguageIds: None,
258-
selectionRange: Some(true),
259-
foldingRange: Some(true),
260-
linkedEditingRange: Some(true),
261-
documentSymbol: Some(true),
262-
documentColor: Some(true),
252+
selectionRange: None,
253+
foldingRange: None,
254+
linkedEditingRange: None,
255+
documentSymbol: None,
256+
documentColor: None,
263257
// 没有格式胡
264258
documentFormatting: None,
265259
}
@@ -286,7 +280,8 @@ pub fn get_initialization_options(name: LanguageOptionEnum) -> Option<Value> {
286280
let initialization_options = ServerInitializationOptions {
287281
// textDocumentSync: TextDocumentSyncKind::Incremental,
288282
typescript: TypescriptPath {
289-
serverPath: "/Users/skymac/node_modules/typescript/lib/tsserverlibrary.js".to_owned(),
283+
// serverPath: "/Users/skymac/node_modules/typescript/lib/tsserverlibrary.js".to_owned(),
284+
serverPath: "/Users/xiaoxin/Library/pnpm/global/5/.pnpm/typescript@4.7.4/node_modules/typescript/lib/tsserverlibrary.js".to_owned(),
290285
localizedPath: None, // localizedPath: Some(
291286
// "/Users/skymac/node_modules/typescript/lib/zh-cn/diagnosticMessages.generated.json"
292287
// .to_owned(),

src/main.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,12 @@ fn initialize(params: InitializeParams) -> Result<()> {
4949
// like file:
5050
scheme: None,
5151
}];
52-
let mut server_args = vec!["--stdio".to_string()];
52+
let mut server_args = vec![
53+
// "/Users/xiaoxin/node_modules/@volar/vue-language-server/out/nodeServer.js".to_string(),
54+
"/Users/johnsonchu/Desktop/GitHub/volar/packages/vue-language-server/bin/vue-language-server.js".to_string(),
55+
"--stdio".to_string(),
56+
"--inspect".to_string(),
57+
];
5358

5459
// Check for user specified LSP server path
5560
// ```

0 commit comments

Comments
 (0)