diff options
Diffstat (limited to 'editors')
-rw-r--r-- | editors/code/package-lock.json | 30 | ||||
-rw-r--r-- | editors/code/package.json | 2 | ||||
-rw-r--r-- | editors/code/rust.tmGrammar.json | 88 | ||||
-rw-r--r-- | editors/code/src/inlay_hints.ts | 2 | ||||
-rw-r--r-- | editors/code/src/util.ts | 5 |
5 files changed, 106 insertions, 21 deletions
diff --git a/editors/code/package-lock.json b/editors/code/package-lock.json index 33d60d4dd..83ef00058 100644 --- a/editors/code/package-lock.json +++ b/editors/code/package-lock.json | |||
@@ -2409,32 +2409,32 @@ | |||
2409 | } | 2409 | } |
2410 | }, | 2410 | }, |
2411 | "vscode-jsonrpc": { | 2411 | "vscode-jsonrpc": { |
2412 | "version": "6.0.0-next.5", | 2412 | "version": "6.0.0-next.7", |
2413 | "resolved": "https://registry.npmjs.org/vscode-jsonrpc/-/vscode-jsonrpc-6.0.0-next.5.tgz", | 2413 | "resolved": "https://registry.npmjs.org/vscode-jsonrpc/-/vscode-jsonrpc-6.0.0-next.7.tgz", |
2414 | "integrity": "sha512-IAgsltQPwg/pXOPsdXgbUTCaO9VSKZwirZN5SGtkdYQ/R3VjeC4v00WTVvoNayWMZpoC3O9u0ogqmsKzKhVasQ==" | 2414 | "integrity": "sha512-1nG+6cuTtpzmXe7yYfO9GCkYlyV6Ai+jDnwidHiT2T7zhc+bJM+VTtc0T/CdTlDyTNTqIcCj0V1nD4TcVjJ7Ug==" |
2415 | }, | 2415 | }, |
2416 | "vscode-languageclient": { | 2416 | "vscode-languageclient": { |
2417 | "version": "7.0.0-next.9", | 2417 | "version": "7.0.0-next.12", |
2418 | "resolved": "https://registry.npmjs.org/vscode-languageclient/-/vscode-languageclient-7.0.0-next.9.tgz", | 2418 | "resolved": "https://registry.npmjs.org/vscode-languageclient/-/vscode-languageclient-7.0.0-next.12.tgz", |
2419 | "integrity": "sha512-lFO+rN/i72CM2va6iKXq1lD7pJg8J93KEXf0w0boWVqU+DJhWzLrV3pXl8Xk1nCv//qOAyhlc/nx2KZCTeRF/A==", | 2419 | "integrity": "sha512-OrzvOvhS5o26C0KctTJC7hkwh3avCwkVhllzy42AqwpIUZ3p2aVqkSG2uVxaeodq8ThBb3TLgtg50vxyWs6FEg==", |
2420 | "requires": { | 2420 | "requires": { |
2421 | "semver": "^6.3.0", | 2421 | "semver": "^6.3.0", |
2422 | "vscode-languageserver-protocol": "3.16.0-next.7" | 2422 | "vscode-languageserver-protocol": "3.16.0-next.10" |
2423 | } | 2423 | } |
2424 | }, | 2424 | }, |
2425 | "vscode-languageserver-protocol": { | 2425 | "vscode-languageserver-protocol": { |
2426 | "version": "3.16.0-next.7", | 2426 | "version": "3.16.0-next.10", |
2427 | "resolved": "https://registry.npmjs.org/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.16.0-next.7.tgz", | 2427 | "resolved": "https://registry.npmjs.org/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.16.0-next.10.tgz", |
2428 | "integrity": "sha512-tOjrg+K3RddJ547zpC9/LAgTbzadkPuHlqJFFWIcKjVhiJOh73XyY+Ngcu9wukGaTsuSGjJ0W8rlmwanixa0FQ==", | 2428 | "integrity": "sha512-YRTctHUZvts0Z1xXKNYU0ha0o+Tlgtwr+6O8OmDquM086N8exiSKBMwMC+Ra1QtIE+1mfW43Wxsme2FnMkAS9A==", |
2429 | "requires": { | 2429 | "requires": { |
2430 | "vscode-jsonrpc": "6.0.0-next.5", | 2430 | "vscode-jsonrpc": "6.0.0-next.7", |
2431 | "vscode-languageserver-types": "3.16.0-next.3" | 2431 | "vscode-languageserver-types": "3.16.0-next.4" |
2432 | } | 2432 | } |
2433 | }, | 2433 | }, |
2434 | "vscode-languageserver-types": { | 2434 | "vscode-languageserver-types": { |
2435 | "version": "3.16.0-next.3", | 2435 | "version": "3.16.0-next.4", |
2436 | "resolved": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.16.0-next.3.tgz", | 2436 | "resolved": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.16.0-next.4.tgz", |
2437 | "integrity": "sha512-s/z5ZqSe7VpoXJ6JQcvwRiPPA3nG0nAcJ/HH03zoU6QaFfnkcgPK+HshC3WKPPnC2G08xA0iRB6h7kmyBB5Adg==" | 2437 | "integrity": "sha512-NlKJyGcET/ZBCCLBYIPaGo2c37R03bPYeWXozUtnjyye7+9dhlbMSODyoG2INcQf8zFmB4qhm2UOJjgYEgPCNA==" |
2438 | }, | 2438 | }, |
2439 | "vscode-test": { | 2439 | "vscode-test": { |
2440 | "version": "1.4.0", | 2440 | "version": "1.4.0", |
diff --git a/editors/code/package.json b/editors/code/package.json index af845d7bc..eccafccdd 100644 --- a/editors/code/package.json +++ b/editors/code/package.json | |||
@@ -36,7 +36,7 @@ | |||
36 | }, | 36 | }, |
37 | "dependencies": { | 37 | "dependencies": { |
38 | "node-fetch": "^2.6.1", | 38 | "node-fetch": "^2.6.1", |
39 | "vscode-languageclient": "7.0.0-next.9" | 39 | "vscode-languageclient": "7.0.0-next.12" |
40 | }, | 40 | }, |
41 | "devDependencies": { | 41 | "devDependencies": { |
42 | "@rollup/plugin-commonjs": "^13.0.2", | 42 | "@rollup/plugin-commonjs": "^13.0.2", |
diff --git a/editors/code/rust.tmGrammar.json b/editors/code/rust.tmGrammar.json index 450116df2..77595aa00 100644 --- a/editors/code/rust.tmGrammar.json +++ b/editors/code/rust.tmGrammar.json | |||
@@ -140,6 +140,12 @@ | |||
140 | }, | 140 | }, |
141 | "patterns": [ | 141 | "patterns": [ |
142 | { | 142 | { |
143 | "include": "#block-comments" | ||
144 | }, | ||
145 | { | ||
146 | "include": "#comments" | ||
147 | }, | ||
148 | { | ||
143 | "include": "#keywords" | 149 | "include": "#keywords" |
144 | }, | 150 | }, |
145 | { | 151 | { |
@@ -456,7 +462,7 @@ | |||
456 | "name": "punctuation.brackets.angle.rust" | 462 | "name": "punctuation.brackets.angle.rust" |
457 | } | 463 | } |
458 | }, | 464 | }, |
459 | "end": "\\{", | 465 | "end": "\\{|;", |
460 | "endCaptures": { | 466 | "endCaptures": { |
461 | "0": { | 467 | "0": { |
462 | "name": "punctuation.brackets.curly.rust" | 468 | "name": "punctuation.brackets.curly.rust" |
@@ -539,9 +545,66 @@ | |||
539 | "include": "#lvariables" | 545 | "include": "#lvariables" |
540 | }, | 546 | }, |
541 | { | 547 | { |
548 | "include": "#constants" | ||
549 | }, | ||
550 | { | ||
551 | "include": "#gtypes" | ||
552 | }, | ||
553 | { | ||
554 | "include": "#functions" | ||
555 | }, | ||
556 | { | ||
557 | "include": "#lifetimes" | ||
558 | }, | ||
559 | { | ||
560 | "include": "#macros" | ||
561 | }, | ||
562 | { | ||
542 | "include": "#namespaces" | 563 | "include": "#namespaces" |
543 | }, | 564 | }, |
544 | { | 565 | { |
566 | "include": "#punctuation" | ||
567 | }, | ||
568 | { | ||
569 | "include": "#strings" | ||
570 | }, | ||
571 | { | ||
572 | "include": "#types" | ||
573 | }, | ||
574 | { | ||
575 | "include": "#variables" | ||
576 | } | ||
577 | ] | ||
578 | }, | ||
579 | { | ||
580 | "comment": "function/method calls with turbofish", | ||
581 | "name": "meta.function.call.rust", | ||
582 | "begin": "((?:r#(?!crate|[Ss]elf|super))?[A-Za-z0-9_]+)(?=::<.*>\\()", | ||
583 | "beginCaptures": { | ||
584 | "1": { | ||
585 | "name": "entity.name.function.rust" | ||
586 | } | ||
587 | }, | ||
588 | "end": "\\)", | ||
589 | "endCaptures": { | ||
590 | "0": { | ||
591 | "name": "punctuation.brackets.round.rust" | ||
592 | } | ||
593 | }, | ||
594 | "patterns": [ | ||
595 | { | ||
596 | "include": "#block-comments" | ||
597 | }, | ||
598 | { | ||
599 | "include": "#comments" | ||
600 | }, | ||
601 | { | ||
602 | "include": "#keywords" | ||
603 | }, | ||
604 | { | ||
605 | "include": "#lvariables" | ||
606 | }, | ||
607 | { | ||
545 | "include": "#constants" | 608 | "include": "#constants" |
546 | }, | 609 | }, |
547 | { | 610 | { |
@@ -557,6 +620,9 @@ | |||
557 | "include": "#macros" | 620 | "include": "#macros" |
558 | }, | 621 | }, |
559 | { | 622 | { |
623 | "include": "#namespaces" | ||
624 | }, | ||
625 | { | ||
560 | "include": "#punctuation" | 626 | "include": "#punctuation" |
561 | }, | 627 | }, |
562 | { | 628 | { |
@@ -641,10 +707,28 @@ | |||
641 | }, | 707 | }, |
642 | { | 708 | { |
643 | "comment": "less than, greater than (special case)", | 709 | "comment": "less than, greater than (special case)", |
644 | "match": "(^|\\s)(?<!=)([<>])\\s", | 710 | "match": "(?:\\b|(?:(\\))|(\\])|(\\})))[ \\t]+([<>])[ \\t]+(?:\\b|(?:(\\()|(\\[)|(\\{)))", |
645 | "captures": { | 711 | "captures": { |
712 | "1": { | ||
713 | "name": "punctuation.brackets.round.rust" | ||
714 | }, | ||
646 | "2": { | 715 | "2": { |
716 | "name": "punctuation.brackets.square.rust" | ||
717 | }, | ||
718 | "3": { | ||
719 | "name": "punctuation.brackets.curly.rust" | ||
720 | }, | ||
721 | "4": { | ||
647 | "name": "keyword.operator.comparison.rust" | 722 | "name": "keyword.operator.comparison.rust" |
723 | }, | ||
724 | "5": { | ||
725 | "name": "punctuation.brackets.round.rust" | ||
726 | }, | ||
727 | "6": { | ||
728 | "name": "punctuation.brackets.square.rust" | ||
729 | }, | ||
730 | "7": { | ||
731 | "name": "punctuation.brackets.curly.rust" | ||
648 | } | 732 | } |
649 | } | 733 | } |
650 | }, | 734 | }, |
diff --git a/editors/code/src/inlay_hints.ts b/editors/code/src/inlay_hints.ts index ed0db2924..38eb1c15b 100644 --- a/editors/code/src/inlay_hints.ts +++ b/editors/code/src/inlay_hints.ts | |||
@@ -60,6 +60,8 @@ function createHintStyle(hintKind: "type" | "parameter" | "chaining") { | |||
60 | color: fg, | 60 | color: fg, |
61 | backgroundColor: bg, | 61 | backgroundColor: bg, |
62 | fontStyle: "normal", | 62 | fontStyle: "normal", |
63 | fontWeight: "normal", | ||
64 | textDecoration: ";font-size:smaller", | ||
63 | }, | 65 | }, |
64 | }), | 66 | }), |
65 | toDecoration(hint: ra.InlayHint, conv: lc.Protocol2CodeConverter): vscode.DecorationOptions { | 67 | toDecoration(hint: ra.InlayHint, conv: lc.Protocol2CodeConverter): vscode.DecorationOptions { |
diff --git a/editors/code/src/util.ts b/editors/code/src/util.ts index 08159b43c..53492a445 100644 --- a/editors/code/src/util.ts +++ b/editors/code/src/util.ts | |||
@@ -75,12 +75,11 @@ export async function sendRequestWithRetry<TParam, TRet>( | |||
75 | log.warn("LSP request timed out", { method: reqType.method, param, error }); | 75 | log.warn("LSP request timed out", { method: reqType.method, param, error }); |
76 | throw error; | 76 | throw error; |
77 | } | 77 | } |
78 | 78 | if (error.code === lc.LSPErrorCodes.RequestCancelled) { | |
79 | if (error.code === lc.ErrorCodes.RequestCancelled) { | ||
80 | throw error; | 79 | throw error; |
81 | } | 80 | } |
82 | 81 | ||
83 | if (error.code !== lc.ErrorCodes.ContentModified) { | 82 | if (error.code !== lc.LSPErrorCodes.ContentModified) { |
84 | log.warn("LSP request failed", { method: reqType.method, param, error }); | 83 | log.warn("LSP request failed", { method: reqType.method, param, error }); |
85 | throw error; | 84 | throw error; |
86 | } | 85 | } |