diff options
-rw-r--r-- | Cargo.toml | 19 | ||||
-rw-r--r-- | crates/ra_assists/src/assists/auto_import.rs | 16 | ||||
-rw-r--r-- | crates/ra_cli/src/analysis_stats.rs | 4 | ||||
-rw-r--r-- | editors/code/src/color_theme.ts | 8 | ||||
-rw-r--r-- | editors/code/src/highlighting.ts | 3 | ||||
-rw-r--r-- | editors/code/tsconfig.json | 3 |
6 files changed, 39 insertions, 14 deletions
diff --git a/Cargo.toml b/Cargo.toml index 31a0560d9..e5620b1b7 100644 --- a/Cargo.toml +++ b/Cargo.toml | |||
@@ -10,5 +10,24 @@ debug = 0 | |||
10 | incremental = true | 10 | incremental = true |
11 | debug = 0 # set this to 1 or 2 to get more useful backtraces in debugger | 11 | debug = 0 # set this to 1 or 2 to get more useful backtraces in debugger |
12 | 12 | ||
13 | # ideally, we would use `build-override` here, but some crates are also | ||
14 | # needed at run-time and we end up compiling them twice | ||
15 | [profile.release.package.proc-macro2] | ||
16 | opt-level = 0 | ||
17 | [profile.release.package.quote] | ||
18 | opt-level = 0 | ||
19 | [profile.release.package.syn] | ||
20 | opt-level = 0 | ||
21 | [profile.release.package.serde_derive] | ||
22 | opt-level = 0 | ||
23 | [profile.release.package.chalk-derive] | ||
24 | opt-level = 0 | ||
25 | [profile.release.package.chalk-macros] | ||
26 | opt-level = 0 | ||
27 | [profile.release.package.salsa-macros] | ||
28 | opt-level = 0 | ||
29 | [profile.release.package.xtask] | ||
30 | opt-level = 0 | ||
31 | |||
13 | [patch.'crates-io'] | 32 | [patch.'crates-io'] |
14 | # rowan = { path = "../rowan" } | 33 | # rowan = { path = "../rowan" } |
diff --git a/crates/ra_assists/src/assists/auto_import.rs b/crates/ra_assists/src/assists/auto_import.rs index 69126a1c9..932a52bff 100644 --- a/crates/ra_assists/src/assists/auto_import.rs +++ b/crates/ra_assists/src/assists/auto_import.rs | |||
@@ -64,12 +64,16 @@ pub(crate) fn auto_import<F: ImportsLocator>( | |||
64 | return None; | 64 | return None; |
65 | } | 65 | } |
66 | 66 | ||
67 | ctx.add_assist_group(AssistId("auto_import"), "auto import", || { | 67 | ctx.add_assist_group( |
68 | proposed_imports | 68 | AssistId("auto_import"), |
69 | .into_iter() | 69 | format!("Import {}", path_to_import_syntax), |
70 | .map(|import| import_to_action(import, &position, &path_to_import_syntax)) | 70 | || { |
71 | .collect() | 71 | proposed_imports |
72 | }) | 72 | .into_iter() |
73 | .map(|import| import_to_action(import, &position, &path_to_import_syntax)) | ||
74 | .collect() | ||
75 | }, | ||
76 | ) | ||
73 | } | 77 | } |
74 | 78 | ||
75 | fn import_to_action(import: String, position: &SyntaxNode, anchor: &SyntaxNode) -> ActionBuilder { | 79 | fn import_to_action(import: String, position: &SyntaxNode, anchor: &SyntaxNode) -> ActionBuilder { |
diff --git a/crates/ra_cli/src/analysis_stats.rs b/crates/ra_cli/src/analysis_stats.rs index fd0027691..833235bff 100644 --- a/crates/ra_cli/src/analysis_stats.rs +++ b/crates/ra_cli/src/analysis_stats.rs | |||
@@ -171,12 +171,12 @@ pub fn run( | |||
171 | println!( | 171 | println!( |
172 | "Expressions of unknown type: {} ({}%)", | 172 | "Expressions of unknown type: {} ({}%)", |
173 | num_exprs_unknown, | 173 | num_exprs_unknown, |
174 | if num_exprs > 0 { (num_exprs_unknown * 100 / num_exprs) } else { 100 } | 174 | if num_exprs > 0 { num_exprs_unknown * 100 / num_exprs } else { 100 } |
175 | ); | 175 | ); |
176 | println!( | 176 | println!( |
177 | "Expressions of partially unknown type: {} ({}%)", | 177 | "Expressions of partially unknown type: {} ({}%)", |
178 | num_exprs_partially_unknown, | 178 | num_exprs_partially_unknown, |
179 | if num_exprs > 0 { (num_exprs_partially_unknown * 100 / num_exprs) } else { 100 } | 179 | if num_exprs > 0 { num_exprs_partially_unknown * 100 / num_exprs } else { 100 } |
180 | ); | 180 | ); |
181 | println!("Type mismatches: {}", num_type_mismatches); | 181 | println!("Type mismatches: {}", num_type_mismatches); |
182 | println!("Inference: {:?}, {}", inference_time.elapsed(), ra_prof::memory_usage()); | 182 | println!("Inference: {:?}, {}", inference_time.elapsed(), ra_prof::memory_usage()); |
diff --git a/editors/code/src/color_theme.ts b/editors/code/src/color_theme.ts index cbad47f35..d816f617d 100644 --- a/editors/code/src/color_theme.ts +++ b/editors/code/src/color_theme.ts | |||
@@ -28,9 +28,11 @@ export class ColorTheme { | |||
28 | static fromRules(rules: TextMateRule[]): ColorTheme { | 28 | static fromRules(rules: TextMateRule[]): ColorTheme { |
29 | const res = new ColorTheme(); | 29 | const res = new ColorTheme(); |
30 | for (const rule of rules) { | 30 | for (const rule of rules) { |
31 | const scopes = typeof rule.scope === 'string' | 31 | const scopes = typeof rule.scope === 'undefined' |
32 | ? [rule.scope] | 32 | ? [] |
33 | : rule.scope; | 33 | : typeof rule.scope === 'string' |
34 | ? [rule.scope] | ||
35 | : rule.scope; | ||
34 | for (const scope of scopes) { | 36 | for (const scope of scopes) { |
35 | res.rules.set(scope, rule.settings); | 37 | res.rules.set(scope, rule.settings); |
36 | } | 38 | } |
diff --git a/editors/code/src/highlighting.ts b/editors/code/src/highlighting.ts index 014e96f75..fc7cd5a1c 100644 --- a/editors/code/src/highlighting.ts +++ b/editors/code/src/highlighting.ts | |||
@@ -1,7 +1,6 @@ | |||
1 | import * as vscode from 'vscode'; | 1 | import * as vscode from 'vscode'; |
2 | import * as lc from 'vscode-languageclient'; | 2 | import * as lc from 'vscode-languageclient'; |
3 | import * as seedrandom_ from 'seedrandom'; | 3 | import seedrandom from 'seedrandom'; |
4 | const seedrandom = seedrandom_; // https://github.com/jvandemo/generator-angular2-library/issues/221#issuecomment-355945207 | ||
5 | 4 | ||
6 | import { ColorTheme, TextMateRuleSettings } from './color_theme'; | 5 | import { ColorTheme, TextMateRuleSettings } from './color_theme'; |
7 | 6 | ||
diff --git a/editors/code/tsconfig.json b/editors/code/tsconfig.json index e60eb8e5e..1ea433961 100644 --- a/editors/code/tsconfig.json +++ b/editors/code/tsconfig.json | |||
@@ -13,7 +13,8 @@ | |||
13 | "noUnusedParameters": true, | 13 | "noUnusedParameters": true, |
14 | "noImplicitReturns": true, | 14 | "noImplicitReturns": true, |
15 | "noFallthroughCasesInSwitch": true, | 15 | "noFallthroughCasesInSwitch": true, |
16 | "newLine": "LF" | 16 | "newLine": "LF", |
17 | "esModuleInterop": true, | ||
17 | }, | 18 | }, |
18 | "exclude": [ | 19 | "exclude": [ |
19 | "node_modules" | 20 | "node_modules" |