aboutsummaryrefslogtreecommitdiff
path: root/editors/code/src/config.ts
Commit message (Collapse)AuthorAgeFilesLines
...
* Merge #3543bors[bot]2020-03-121-3/+15
|\ | | | | | | | | | | | | | | | | | | | | | | | | 3543: Parameter inlay hint separate from variable type inlay? #2876 r=matklad a=slyngbaek Add setting to allow enabling either type inlay hints or parameter inlay hints or both. Group the the max inlay hint length option into the object. - Add a new type for the inlayHint options. - Add tests to ensure the inlays don't happen on the server side Co-authored-by: Steffen Lyngbaek <[email protected]>
| * Make maxLength nullable againSteffen Lyngbaek2020-03-121-2/+2
| |
| * Switch from Vec<InlayKind> to object with propsSteffen Lyngbaek2020-03-121-6/+7
| | | | | | | | | | | | | | - Instead of a single object type, use several individual nested types to allow toggling from the settings GUI - Remove unused struct definitions - Install and test that the toggles work
| * Address Issues from GithubSteffen Lyngbaek2020-03-101-1/+3
| | | | | | | | | | | | | | - Updated naming of config - Define struct in ra_ide and use remote derive in rust-analyzer/config - Make inlayConfig type more flexible to support more future types - Remove constructor only used in tests
| * Parameter inlay hint separate from variable type inlay? #2876Steffen Lyngbaek2020-03-101-2/+11
| | | | | | | | | | | | | | | | | | Add setting to allow enabling either type inlay hints or parameter inlay hints or both. Group the the max inlay hint length option into the object. - Add a new type for the inlayHint options. - Add tests to ensure the inlays don't happen on the server side
* | Add additional_outdirs in configEdwin Cheng2020-03-101-0/+1
|/
* vscode: groupd updates-related config under `updates` section as per @matkladVeetaha2020-03-091-1/+1
|
* vscode: fix inversion of askBeforeDownloadVeetaha2020-03-081-1/+1
|
* vscode: rename alwaysDownloadServer -> askBeforeDownloadVeetaha2020-03-081-1/+1
| | | | | | | | | | | The new name seems much simpler and it doesn't limit this config value only to downloading the server binary. Thus we wouldn't need to create another config properties to handle other downloads whatsoever. Anyway, I believe (heuristically) that most of the users would want to set "askBeforeDownload": false once and never bother clicking on the notification again (because otherwise there is no big point in installing rust-analyzer if it cannot install the server)
* vscode: care about alwaysDownloadServer option before askingVeetaha2020-03-071-5/+6
| | | | | | | Also renamed BinarySource to ArtifactSource in anticipation of nightlies installation that requires downloading not a binary itself but .vsix package, thus generalized to `artifact` term
* Config to switch to semantic tokensAleksey Kladov2020-02-261-0/+2
|
* Extract client-side loggingAleksey Kladov2020-02-221-1/+4
|
* Rename config value for server PathAleksey Kladov2020-02-181-1/+1
|
* Rename the binary to rust-analyzerAleksey Kladov2020-02-181-4/+4
|
* Migrate to eslintAleksey Kladov2020-02-171-17/+17
|
* Merge #3181bors[bot]2020-02-171-1/+2
|\ | | | | | | | | | | | | | | 3181: Add ability to pass additional arguments to rustfmt. r=matklad a=Leonqn relates to #2848 Co-authored-by: Ilya Titkov <[email protected]>
| * Add arguments to rustfmtIlya Titkov2020-02-171-1/+2
| |
* | vscode: minor refactoringsVeetaha2020-02-171-1/+0
|/
* Merge #3162bors[bot]2020-02-161-1/+16
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | 3162: Feature: vscode always downloads only the matching ra_lsp_server version r=matklad a=Veetaha I tried to separate logically connected changes into separate commits, so enjoy! Now TypeScript extension saves installed binary version in global state and always checks that the installed binary version equals the version of the TypeScript extension itself (to prevent version drifts). Also, changed `fetchLatestArtifactReleaseInfo()` to `fetchArtifactReleaseInfo()` that takes an optional release tag (when not specified fetches the latest release). The version without a release tag will be useful in the future when adding auto-checking for updates. I decided not to do `Download latest language server` command (I have stated the rationale for this in #3073) and let the extension itself decide which version of the binary it wants. This way the users will be able to get the latest `ra_lsp_server` binary after the approaching 2020-02-17 release, without having to manually delete the outdated one from `~/.config/Code/User/globalStorage/matklad.rust-analyzer`! Closes #3073 Co-authored-by: Veetaha <[email protected]>
| * vscode: add version and storage parameters to github binary sourceVeetaha2020-02-161-1/+16
| |
* | vscode: fix the default value for withSysrootVeetaha2020-02-161-1/+1
|/
* vscode: renamed langServer to serverVeetaha2020-02-141-6/+6
|
* make onConfigChange handler privateVeetaha2020-02-141-1/+1
|
* vscode: moved to getters as per matkladVeetaha2020-02-141-23/+17
|
* vscode: reordered config constructor before methodsVeetaha2020-02-131-5/+6
|
* vscode: redesigned config with simplicity and Dart extension config ↵Veetaha2020-02-131-190/+68
| | | | implementation in mind
* vscode: filter out arm linux from using prebuilt binariesVeetaha2020-02-111-3/+20
|
* vscode: refactor inverted ternaries to if statements as per @matkladVeetaha2020-02-091-1/+3
|
* vscode: rename raLspServer variable to langServerVeetaha2020-02-081-3/+3
|
* vscode: refactor commentVeetaha2020-02-081-1/+1
|
* vscode: refactor platform artifact name query to switch statement, move ↵Veetaha2020-02-081-36/+53
| | | | BinarySource union variants into a namespace
* vscode: amended config to use binary from globalStoragePath, added ui for ↵Veetaha2020-02-081-7/+49
| | | | downloading
* Merge #3024bors[bot]2020-02-051-1/+1
|\ | | | | | | | | | | | | | | 3024: vscode: eliminate floating promises and insane amount of resource handle leaks r=matklad a=Veetaha Khm, yeah ... Co-authored-by: Veetaha <[email protected]>
| * vscode: eliminate floating promises and insane amount of resource handle leaksVeetaha2020-02-051-1/+1
| |
* | vscode: yet another refactor commitVeetaha2020-02-041-2/+2
|/
* Improve readabilitymemoryruins2020-01-151-14/+11
|
* Display vscode message after changing cargo-watch optionsmemoryruins2020-01-151-0/+19
|
* Refactor configAleksey Kladov2019-12-311-6/+4
|
* Drop needless pubsAleksey Kladov2019-12-311-14/+14
|
* Drop support for legacy colorizationAleksey Kladov2019-12-311-4/+0
|
* Switch impure functional style to pure imperativeAleksey Kladov2019-12-311-2/+0
|
* Reformat with tsfmtAleksey Kladov2019-12-301-2/+2
|
* Privatize highlightingAleksey Kladov2019-12-301-3/+0
|
* Merge #2061bors[bot]2019-12-291-5/+9
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2061: Theme loading and "editor.tokenColorCustomizations" support. r=matklad a=seivan Fixes: [Issue#1294](https://github.com/rust-analyzer/rust-analyzer/issues/1294#issuecomment-497450325) TODO: - [x] Load themes - [x] Load existing `ralsp`-prefixed overrides from `"workbench.colorCustomizations"`. - [x] Load overrides from `"editor.tokenColorCustomizations.textMateRules"`. - [x] Use RA tags to load `vscode.DecorationRenderOptions` (colors) from theme & overrides. - [x] Map RA tags to common TextMate scopes before loading colors. - [x] Add default scope mappings in extension. - [x] Cache mappings between settings updates. - [x] Add scope mapping configuration manifest in `package.json` - [x] Load configurable scope mappings from settings. - [x] Load JSON Scheme for text mate scope rules in settings. - [x] Update [Readme](https://github.com/seivan/rust-analyzer/blob/feature/themes/docs/user/README.md#settings). Borrowed the theme loading (`scopes.ts`) from `Tree Sitter` with some modifications to reading `"editor.tokenColorCustomizations"` for merging with loaded themes and had to remove the async portions to be able to load it from settings updates. ~Just a PoC and an idea I toyed around with a lot of room for improvement.~ For starters, certain keywords aren't part of the standard TextMate grammar, so it still reads colors from the `ralsp` prefixed values in `"workbench.colorCustomizations"`. But I think there's more value making the extension work with existing themes by maping some of the decoration tags to existing key or keys. <img width="453" alt="Screenshot 2019-11-09 at 17 43 18" src="https://user-images.githubusercontent.com/55424/68531968-71b4e380-0318-11ea-924e-cdbb8d5eae06.png"> <img width="780" alt="Screenshot 2019-11-09 at 17 41 45" src="https://user-images.githubusercontent.com/55424/68531950-4b8f4380-0318-11ea-8f85-24a84efaf23b.png"> <img width="468" alt="Screenshot 2019-11-09 at 17 40 29" src="https://user-images.githubusercontent.com/55424/68531952-51852480-0318-11ea-800a-6ae9215f5368.png"> These will merge with the default ones coming with the extension, so you don't have to implement all of them and works well with overrides defined in settings. ```jsonc "editor.tokenColorCustomizations": { "textMateRules": [ { "scope": "keyword", "settings": { "fontStyle": "bold", } }, ] }, ``` Edit: The idea is to work with 90% of the themes out there by working within existing scopes available that are generally styled. It's not to say I want to erase the custom Rust scopes - those should still remain and eventually worked into a custom grammar bundle for Rust specific themes that target those, I just want to make it work with generic themes offered on the market place for now. A custom grammar bundle and themes for Rust specific scopes is out of... scope for this PR. We'll make another round to tackle those issues. Current fallbacks implemented ```typescript [ 'comment', [ 'comment', 'comment.block', 'comment.line', 'comment.block.documentation' ] ], ['string', ['string']], ['keyword', ['keyword']], ['keyword.control', ['keyword.control', 'keyword', 'keyword.other']], [ 'keyword.unsafe', ['storage.modifier', 'keyword.other', 'keyword.control', 'keyword'] ], ['function', ['entity.name.function']], ['parameter', ['variable.parameter']], ['constant', ['constant', 'variable']], ['type', ['entity.name.type']], ['builtin', ['variable.language', 'support.type', 'support.type']], ['text', ['string', 'string.quoted', 'string.regexp']], ['attribute', ['keyword']], ['literal', ['string', 'string.quoted', 'string.regexp']], ['macro', ['support.other']], ['variable', ['variable']], ['variable.mut', ['variable', 'storage.modifier']], [ 'field', [ 'variable.object.property', 'meta.field.declaration', 'meta.definition.property', 'variable.other' ] ], ['module', ['entity.name.section', 'entity.other']] ``` Co-authored-by: Seivan Heidari <[email protected]>
| * Merge branch 'master' into feature/themesSeivan Heidari2019-12-231-24/+89
| |\
| * | Vscode wasn't running the linter automatically so ran `npm run fix` - wonder ↵Seivan Heidari2019-11-091-3/+2
| | | | | | | | | | | | if it's related to `tslint` being deprecated.
| * | * Adding scope mapping configuration manifest in `package.json`Seivan Heidari2019-11-041-6/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Loading configurable scope mappings from settings. * Updating Readme with `rust-analyzer.scopeMappings`. `rust-analyzer.scopeMappings` -- a scheme backed JSON object to tweak Rust Analyzer scopes to TextMate scopes. ```jsonc { //Will autocomplete keys to available RA scopes. "keyword.unsafe": ["keyword", "keyword.control"], //Values are string | TextMateScope | [string | TextMateScope] "comments": "comment.block" } ```
| * | Merge branch 'master' into feature/themesSeivan Heidari2019-10-311-7/+0
| |\ \
| * | | Introducing a Scopes Mapper to map from RA scopes to TextMate scopes with ↵Seivan Heidari2019-10-271-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | fallbacks. Current scopes defined: ``` ['keyword.unsafe', ['storage.modifier', 'keyword.other', 'keyword.control']], ['function', ['entity.name.function']], ['parameter', ['variable.parameter']], ['type', ['entity.name.type']], ['builtin', ['variable.language', 'support.type', 'support.type']], ['text', ['string', 'string.quoted', 'string.regexp']], ['attribute', ['keyword']], ['literal', ['string', 'string.quoted', 'string.regexp']], ['macro', ['support.other']], ['variable.mut', ['variable']], ['field', ['variable.object.property']], ['module', ['entity.name.section']] ``` Need to complement with further fallbacks as some themes fail.
| * | | Proof of concept theming and 'tokenColorCustomizations' support.Seivan Heidari2019-10-241-1/+5
| | | |