aboutsummaryrefslogtreecommitdiff
path: root/crates
Commit message (Collapse)AuthorAgeFilesLines
* feature flag unix specific stuffHEADmasterAkshay2021-06-232-5/+11
|
* Add `public` semantic token modifier for public itemsAramis Razzaghipour2021-06-239-35/+67
|
* Rewrite `convert_tokens` to use an explicit stackJonas Schievink2021-06-221-40/+80
|
* Move subtree collection out of `TokenConvertor`Jonas Schievink2021-06-221-124/+124
|
* Fix compilation on WASMFlorian Diebold2021-06-222-2/+21
| | | | | Fixes #9214. Fixes #9210.
* internal: remove one more accidentally quadratic code-pathAleksey Kladov2021-06-222-26/+32
| | | | | | | | | | | | | | Definition::visibility was implemented in a rather roundabout way -- by asking the parent module about the effective visibility. This is problematic for a couple of reasons: * first, it doesn't work for local items * second, asking module about visibility of a child is a linear operation (that's a problem in itself, tracked in #9378) Instead, lets ask the declared visibility directly, we have all the code for it, and need only to actually us it.
* internal: count ItemScopesAleksey Kladov2021-06-221-0/+4
|
* minor: clarify namingAleksey Kladov2021-06-222-7/+11
|
* Merge #9374bors[bot]2021-06-222-4/+4
|\ | | | | | | | | | | | | | | 9374: Update crates r=kjeremy a=kjeremy Drops byteorder Co-authored-by: kjeremy <[email protected]>
| * Update crateskjeremy2021-06-222-4/+4
| |
* | Factor out `pick_best_token` ide pattern into `ide_db`Lukas Wirth2021-06-229-101/+62
|/
* intenral: dont export impl detailsAleksey Kladov2021-06-222-7/+5
|
* minor: extend source_to_def docsAleksey Kladov2021-06-221-2/+18
|
* internal: document source_to_def and it's connection to Kotlin&RoslynAleksey Kladov2021-06-221-0/+69
|
* Merge #9368bors[bot]2021-06-221-2/+15
|\ | | | | | | | | | | | | | | | | 9368: fix: Prefer identifier tokens in expand_macro r=Veykril a=Veykril Fixes #9366 bors r+ Co-authored-by: Lukas Wirth <[email protected]>
| * Prefer identifier tokens in expand_macroLukas Wirth2021-06-221-2/+15
| |
* | Merge #9367bors[bot]2021-06-221-0/+9
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | 9367: Document perf characteristic of to_node r=matklad a=matklad bors r+ 🤖 Co-authored-by: Aleksey Kladov <[email protected]>
| * | Document perf characteristic of to_nodeAleksey Kladov2021-06-221-0/+9
| | |
* | | Merge #9348bors[bot]2021-06-211-1/+8
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | 9348: output to log file if RA_LOG_FILE is defined in environment r=rezural a=rezural This adds a check for RA_LOG_FILE, and logs to that if defined. It currently overrides flags.log_file. If this is undesirable, I will add a check. Co-authored-by: rezural <[email protected]>
| * | | output to log file if RA_LOG_FILE is defined in environmentrezural2021-06-211-1/+8
| | | |
* | | | Merge #9364bors[bot]2021-06-214-97/+157
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 9364: Split hover actions config into its own config struct r=Veykril a=Veykril bors r+ Co-authored-by: Lukas Wirth <[email protected]>
| * | | | Collapse documentation and markdown config settings into an enumLukas Wirth2021-06-213-39/+70
| | | | |
| * | | | Split hover actions config into its own config structLukas Wirth2021-06-214-81/+110
| | | | |
* | | | | Merge #9363bors[bot]2021-06-211-4/+10
|\ \ \ \ \ | |/ / / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 9363: Set explicit target directory to avoid cargo deadlock r=jonas-schievink a=oxalica Fix #9360 r? @jonas-schievink Co-authored-by: oxalica <[email protected]>
| * | | | Set explicit target directory to avoid cargo deadlockoxalica2021-06-211-4/+10
| | |/ / | |/| |
* | | | Merge #9362bors[bot]2021-06-211-1/+1
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 9362: feature: massively improve performance for large files r=matklad a=matklad bors r+ 🤖 Co-authored-by: Aleksey Kladov <[email protected]>
| * | | | feature: massively improve performance for large filesAleksey Kladov2021-06-211-1/+1
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This story begins in #8384, where we added a smart test for our syntax highting, which run the algorithm on synthetic files of varying length in order to guesstimate if the complexity is O(N^2) or O(N)-ish. The test turned out to be pretty effective, and flagged #9031 as a change that makes syntax highlighting accidentally quadratic. There was much rejoicing, for the time being. Then, lnicola asked an ominous question[1]: "Are we sure that the time is linear right now?" Of course it turned out that our sophisticated non-linearity detector *was* broken, and that our syntax highlighting *was* quadratic. Investigating that, many brave hearts dug deeper and deeper into the guts of rust-analyzer, only to get lost in a maze of traits delegating to traits delegating to macros. Eventually, matklad managed to peel off all layers of abstraction one by one, until almost nothing was left. In fact, the issue was discovered in the very foundation of the rust-analyzer -- in the syntax trees. Worse, it was not a new problem, but rather a well-know, well-understood and event (almost) well-fixed (!) performance bug. The problem lies within `SyntaxNodePtr` type -- a light-weight "address" of a node in a syntax tree [3]. Such pointers are used by rust-analyzer all other the place to record relationships between IR nodes and the original syntax. Internally, the pointer to a syntax node is represented by node's range. To "dereference" the pointer, you traverse the syntax tree from the root, looking for the node with the right range. The inner loop of this search is finding a node's child whose range contains the specified range. This inner loop was implemented by naive linear search over all the children. For wide trees, dereferencing a single `SyntaxNodePtr` was linear. The problem with wide trees though is that they contain a lot of nodes! And dereferencing pointers to all the nodes is quadratic in the size of the file! The solution to this problem is to speed up the children search -- rather than doing a linear lookup, we can use binary search to locate the child with the desired interval. Doing this optimization was one of the motivations (or rather, side effects) of #6857. That's why `rowan` grew the useful `child_or_token_at_range` method which does exactly this binary search. But looks like we've never actually switch to this method? Oups. Lesson learned: do not leave broken windows in the fundamental infra. Otherwise, you'll have to repeatedly re-investigate the issue, by digging from the top of the Everest down to the foundation! [1]: https://rust-lang.zulipchat.com/#narrow/stream/185405-t-compiler.2Frust-analyzer/topic/.60syntax_highlighting_not_quadratic.60.20failure/near/240811501 [2]: https://rust-lang.zulipchat.com/#narrow/stream/185405-t-compiler.2Frust-analyzer/topic/Syntax.20highlighting.20is.20quadratic [3]: https://rust-lang.zulipchat.com/#narrow/stream/185405-t-compiler.2Frust-analyzer/topic/Syntax.20highlighting.20is.20quadratic/near/243412392
* | | | Move features into potential_cfg_optionsJamie Cunliffe2021-06-216-38/+32
| | | |
* | | | Improve completion of cfg attributesJamie Cunliffe2021-06-218-0/+185
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The completion of cfg will look at the enabled cfg keys when performing completion. It will also look crate features when completing a feature cfg option. A fixed list of known values for some cfg options are provided. For unknown keys it will look at the enabled values for that cfg key, which means that completion will only show enabled options for those.
* | | Merge #9165bors[bot]2021-06-2119-80/+66
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | 9165: Apply some clippy suggestions r=matklad a=clemenswasser Co-authored-by: Clemens Wasser <[email protected]>
| * | | Apply some clippy suggestionsClemens Wasser2021-06-2119-80/+66
| | | |
* | | | Merge #9264bors[bot]2021-06-214-105/+112
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 9264: feat: Make documentation on hover configurable r=Veykril a=Veykril This also implements deprecation support for config options as this renames `hoverActions_linksInHover` to `hover_linksInHover`. Fixes #9232 Co-authored-by: Lukas Wirth <[email protected]>
| * | | | Remove deprecation support in configLukas Wirth2021-06-211-39/+13
| | | | |
| * | | | typoLukas Wirth2021-06-141-1/+1
| | | | |
| * | | | Add configuration deprecationLukas Wirth2021-06-141-10/+39
| | | | |
| * | | | Don't ignore hover documentation setting for keyword hoversLukas Wirth2021-06-141-2/+4
| | | | |
| * | | | Make documentation on hover configurableLukas Wirth2021-06-144-103/+105
| | | | |
* | | | | Merge #9314bors[bot]2021-06-211-6/+20
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 9314: Fix extract_function with await r=sasurau4 a=sasurau4 Fix #9287 Co-authored-by: Daiki Ihara <[email protected]>
| * | | | | Fix var nameDaiki Ihara2021-06-211-7/+7
| | | | | |
| * | | | | Fix pointed outDaiki Ihara2021-06-211-5/+16
| | | | | |
| * | | | | Fix extract_function with awaitDaiki Ihara2021-06-211-2/+5
| | | | | |
* | | | | | Merge #9227bors[bot]2021-06-215-49/+115
|\ \ \ \ \ \ | |_|_|/ / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 9227: Add a config setting to disable the 'test' cfg in specified crates r=matklad a=lf- If you are opening libcore from rust-lang/rust as opposed to e.g. goto definition from some other crate which would use the sysroot instance of libcore, a `#![cfg(not(test))]` would previously have made all the code excluded from the module tree, breaking the editor experience. Core does not need to ever be edited with `#[cfg(test)]` enabled, as the tests are in another crate. This PR puts in a slight hack that checks for the crate name "core" and turns off `#[cfg(test)]` for that crate. Fixes #9203 Fixes #9226 Co-authored-by: Jade <[email protected]>
| * | | | | Implement a config override for the default #[cfg(test)] in cargo cratesJade2021-06-195-55/+93
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes crates which vanish when the 'test' cfg atom is set. Fix #7243. Fix #9203. Fix #7225.
| * | | | | Fix libcore not being included in rust-lang/rust module treeJade2021-06-192-2/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If you are opening libcore from rust-lang/rust as opposed to e.g. goto definition from some other crate which would use the sysroot instance of libcore, a `#![cfg(not(test))]` would previously have made all the code excluded from the module tree, breaking the editor experience. This puts in a slight hack that checks for the crate name "core" and turns off `#[cfg(test)]`.
* | | | | | Update sysroot cratesJonas Schievink2021-06-211-6/+5
| | | | | |
* | | | | | Merge #9356bors[bot]2021-06-2110-677/+557
|\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 9356: internal: Move out and regroup more completion tests r=Veykril a=Veykril bors r+ Co-authored-by: Lukas Wirth <[email protected]>
| * | | | | | Various keyword completion fixesLukas Wirth2021-06-214-16/+22
| | | | | | |
| * | | | | | Move out completion type position testsLukas Wirth2021-06-215-206/+198
| | | | | | |
| * | | | | | Move out completion pattern testsLukas Wirth2021-06-215-467/+349
| | |_|_|_|/ | |/| | | |
* | | | | | Don't insert `}` when typing `{` in stringJonas Schievink2021-06-211-3/+33
| |_|/ / / |/| | | |