Repository: rust-lang/rust-analyzer
Pull request #12238 (2022-05-13 11:23:04)

feat: Change VSCode extension publisher to `rust-lang`


Patch:
diff --git a/crates/mbe/src/syntax_bridge.rs b/crates/mbe/src/syntax_bridge.rs
index 361633e39d..fb6f8d66c6 100644
--- a/crates/mbe/src/syntax_bridge.rs
+++ b/crates/mbe/src/syntax_bridge.rs
@@ -243,8 +243,6 @@ fn convert_tokens<C: TokenConvertor>(conv: &mut C) -> tt::Subtree {
             let char = match token.to_char(conv) {
                 Some(c) => c,
                 None => {
-                    // FIXME: this isn't really correct, `to_char` yields the *first* char of the token,
-                    // and this is relevant when eg. creating 2 `tt::Punct` from a single `::` token
                     panic!("Token from lexer must be single char: token = {:#?}", token);
                 }
             };
diff --git a/crates/parser/src/grammar.rs b/crates/parser/src/grammar.rs
index 4ebf2157c6..f68d7196c8 100644
--- a/crates/parser/src/grammar.rs
+++ b/crates/parser/src/grammar.rs
@@ -324,9 +324,7 @@ fn name_ref_or_index(p: &mut Parser) {
     );
     let m = p.start();
     if p.at(FLOAT_NUMBER_PART) || p.at_ts(FLOAT_LITERAL_FIRST) {
-        // Ideally we'd remap this to `INT_NUMBER` instead, but that causes the MBE conversion to
-        // lose track of what's a float and what isn't, causing panics.
-        p.bump_remap(FLOAT_NUMBER_PART);
+        p.bump_remap(INT_NUMBER);
     } else {
         p.bump_any();
     }
diff --git a/docs/user/manual.adoc b/docs/user/manual.adoc
index 27f10da103..e8520c66f4 100644
--- a/docs/user/manual.adoc
+++ b/docs/user/manual.adoc
@@ -61,7 +61,7 @@ The rust-analyzer plugin for VS Code is maintained
 https://github.com/rust-analyzer/rust-analyzer/tree/master/editors/code[in tree].
 
 You can install the latest release of the plugin from
-https://marketplace.visualstudio.com/items?itemName=matklad.rust-analyzer[the marketplace].
+https://marketplace.visualstudio.com/items?itemName=rust-lang.rust-analyzer[the marketplace].
 
 Note that the plugin may cause conflicts with the
 https://marketplace.visualstudio.com/items?itemName=rust-lang.rust[official Rust plugin].
@@ -81,14 +81,14 @@ To disable this notification put the following to `settings.json`
 ----
 ====
 
-The server binary is stored in the extension install directory, which starts with `matklad.rust-analyzer-` and is located under:
+The server binary is stored in the extension install directory, which starts with `rust-lang.rust-analyzer-` and is located under:
 
 * Linux: `~/.vscode/extensions`
 * Linux (Remote, such as WSL): `~/.vscode-server/extensions`
 * macOS: `~/.vscode/extensions`
 * Windows: `%USERPROFILE%\.vscode\extensions`
 
-As an exception, on NixOS, the extension makes a copy of the server and stores it under `~/.config/Code/User/globalStorage/matklad.rust-analyzer`.
+As an exception, on NixOS, the extension makes a copy of the server and stores it under `~/.config/Code/User/globalStorage/rust-lang.rust-analyzer`.
 
 Note that we only support the two most recent versions of VS Code.
 
diff --git a/editors/code/README.md b/editors/code/README.md
index 0f0d292b5c..9113722632 100644
--- a/editors/code/README.md
+++ b/editors/code/README.md
@@ -34,7 +34,7 @@ This extension provides support for the [Rust programming language](https://www.
 2. Install the [rust-analyzer extension]
 
 [rustup]: https://rustup.rs
-[rust-analyzer extension]: https://marketplace.visualstudio.com/items?itemName=matklad.rust-analyzer
+[rust-analyzer extension]: https://marketplace.visualstudio.com/items?itemName=rust-lang.rust-analyzer
 
 ## Configuration
 
diff --git a/editors/code/package.json b/editors/code/package.json
index 7fa04fbb9a..a88f605f47 100644
--- a/editors/code/package.json
+++ b/editors/code/package.json
@@ -7,7 +7,7 @@
     "icon": "icon.png",
     "version": "0.4.0-dev",
     "releaseTag": null,
-    "publisher": "matklad",
+    "publisher": "ryst-lang",
     "repository": {
         "url": "https://github.com/rust-analyzer/rust-analyzer.git",
         "type": "git"
diff --git a/editors/code/src/config.ts b/editors/code/src/config.ts
index bf4572fcf6..d34e82a1a6 100644
--- a/editors/code/src/config.ts
+++ b/editors/code/src/config.ts
@@ -10,7 +10,7 @@ const NIGHTLY_TAG = "nightly";
 export type RunnableEnvCfg = undefined | Record<string, string> | { mask?: string; env: Record<string, string> }[];
 
 export class Config {
-    readonly extensionId = "matklad.rust-analyzer";
+    readonly extensionId = "rust-lang.rust-analyzer";
 
     readonly rootSection = "rust-analyzer";
     private readonly requiresReloadOpts = [
diff --git a/editors/code/src/main.ts b/editors/code/src/main.ts
index 7591865390..39bd73c663 100644
--- a/editors/code/src/main.ts
+++ b/editors/code/src/main.ts
@@ -287,7 +287,7 @@ async function isNixOs(): Promise<boolean> {
 function warnAboutExtensionConflicts() {
     if (vscode.extensions.getExtension("rust-lang.rust")) {
         vscode.window.showWarningMessage(
-            `You have both the rust-analyzer (matklad.rust-analyzer) and Rust (rust-lang.rust) ` +
+            `You have both the rust-analyzer (rust-lang.rust-analyzer) and Rust (rust-lang.rust) ` +
             "plugins enabled. These are known to conflict and cause various functions of " +
             "both plugins to not work correctly. You should disable one of them.", "Got it")
             .then(() => { }, console.error);


Test patch:
diff --git a/crates/hir-def/src/macro_expansion_tests/proc_macros.rs b/crates/hir-def/src/macro_expansion_tests/proc_macros.rs
index e4b065d020..0ca30fb799 100644
--- a/crates/hir-def/src/macro_expansion_tests/proc_macros.rs
+++ b/crates/hir-def/src/macro_expansion_tests/proc_macros.rs
@@ -92,40 +92,3 @@ fn foo() {
 }"##]],
     );
 }
-
-#[test]
-fn float_parsing_panic() {
-    // Regression test for https://github.com/rust-lang/rust-analyzer/issues/12211
-    check(
-        r#"
-//- proc_macros: identity
-macro_rules! id {
-    ($($t:tt)*) => {
-        $($t)*
-    };
-}
-
-id! {
-    #[proc_macros::identity]
-    impl Foo for WrapBj {
-        async fn foo(&self) {
-            self.0. id().await;
-        }
-    }
-}
-"#,
-        expect![[r##"
-macro_rules! id {
-    ($($t:tt)*) => {
-        $($t)*
-    };
-}
-
-#[proc_macros::identity] impl Foo for WrapBj {
-    async fn foo(&self ) {
-        self .0.id().await ;
-    }
-}
-"##]],
-    );
-}
diff --git a/crates/parser/test_data/parser/inline/ok/0011_field_expr.rast b/crates/parser/test_data/parser/inline/ok/0011_field_expr.rast
index a1efb3a9fb..19fab593fa 100644
--- a/crates/parser/test_data/parser/inline/ok/0011_field_expr.rast
+++ b/crates/parser/test_data/parser/inline/ok/0011_field_expr.rast
@@ -50,7 +50,7 @@ SOURCE_FILE
                       IDENT "x"
               DOT "."
               NAME_REF
-                FLOAT_NUMBER_PART "0"
+                INT_NUMBER "0"
             DOT "."
             WHITESPACE " "
             NAME_REF
@@ -67,10 +67,10 @@ SOURCE_FILE
                       IDENT "x"
               DOT "."
               NAME_REF
-                FLOAT_NUMBER_PART "0"
+                INT_NUMBER "0"
             DOT "."
             NAME_REF
-              FLOAT_NUMBER_PART "1"
+              INT_NUMBER "1"
           SEMICOLON ";"
         WHITESPACE "\n    "
         EXPR_STMT