aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide/src/syntax_highlighting.rs
Commit message (Collapse)AuthorAgeFilesLines
* Highlight the name in macro declarationsMatthew Jasper2020-05-101-0/+13
|
* Highlight mutable statics as mutableMatthew Jasper2020-05-101-1/+7
|
* Introduce new semantic highlight token for format specifierLeander Tentrup2020-04-281-1/+1
|
* Rename StructField -> FieldAleksey Kladov2020-04-251-1/+1
|
* Convert code to text-sizeAleksey Kladov2020-04-251-6/+6
|
*-. Merge #3998 #4006bors[bot]2020-04-241-56/+168
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 3998: Make add_function generate functions in other modules via qualified path r=matklad a=TimoFreiberg Additional feature for #3639 - [x] Add tests for paths with more segments - [x] Make generating the function in another file work - [x] Add `pub` or `pub(crate)` to the generated function if it's generated in a different module - [x] Make the assist jump to the edited file - [x] Enable file support in the `check_assist` helper 4006: Syntax highlighting for format strings r=matklad a=ltentrup I have an implementation for syntax highlighting for format string modifiers `{}`. The first commit refactors the changes in #3826 into a separate struct. The second commit implements the highlighting: first we check in a macro call whether the macro is a format macro from `std`. In this case, we remember the format string node. If we encounter this node during syntax highlighting, we check for the format modifiers `{}` using regular expressions. There are a few places which I am not quite sure: - Is the way I extract the macro names correct? - Is the `HighlightTag::Attribute` suitable for highlighting the `{}`? Let me know what you think, any feedback is welcome! Co-authored-by: Timo Freiberg <[email protected]> Co-authored-by: Leander Tentrup <[email protected]> Co-authored-by: Leander Tentrup <[email protected]>
| | * Adapt format specifier highlighting to support escaped squences and unicode ↵Leander Tentrup2020-04-221-22/+41
| | | | | | | | | | | | identifiers
| | * Apply suggestions from code reviewLeander Tentrup2020-04-221-4/+3
| | | | | | | | | | | | Co-Authored-By: bjorn3 <[email protected]>
| | * Implement syntax highlighting for format stringsLeander Tentrup2020-04-201-3/+66
| | | | | | | | | | | | | | | | | | | | | Detailed changes: 1) Implement a lexer for string literals that divides the string in format specifier `{}` including the format specifier modifier. 2) Adapt syntax highlighting to add ranges for the detected sequences. 3) Add a test case for the format string syntax highlighting.
| | * Refactor flattening logic for highlighted syntax rangesLeander Tentrup2020-04-181-54/+85
| | |
* | | Introduce ActiveParameterAleksey Kladov2020-04-241-5/+3
|/ /
* / Add semantic tag for unresolved referencesAleksey Kladov2020-04-181-14/+15
|/ | | | | | | | | | | This is a quick way to implement unresolved reference diagnostics. For example, adding to VS Code config "editor.tokenColorCustomizationsExperimental": { "unresolvedReference": "#FF0000" }, will highlight all unresolved refs in red.
* Fix incorrect order of syntax highlight rangesLeander Tentrup2020-04-171-1/+2
|
* Merge #3826bors[bot]2020-04-081-5/+54
|\ | | | | | | | | | | | | | | | | | | | | | | | | 3826: Flatten nested highlight ranges during DFS traversal r=matklad a=ltentrup Implements the flattening of nested highlights from #3447. There is a caveat: I needed to add `Clone` to `HighlightedRange` to split highlight ranges ~and the nesting does not appear in the syntax highlighting test (it does appear in the accidental-quadratic test but there it is not checked against a ground-truth)~. I have added a test case for the example mentioned in #3447. Co-authored-by: Leander Tentrup <[email protected]>
| * Simplify HTML highlighter and add test case for highlight_injection logicLeander Tentrup2020-04-061-1/+7
| |
| * Flatten nested highlight ranges during DFS traversalLeander Tentrup2020-04-031-6/+49
| |
* | Make control token modifier less ambiguousAleksey Kladov2020-04-061-1/+1
|/ | | | | | | | | In textmate, keyword.control is used for all kinds of things; in fact, the default scope mapping for keyword is keyword.control! So let's add a less ambiguous controlFlow modifier See Microsoft/vscode#94367
* Fix importsAleksey Kladov2020-03-031-6/+2
|
* Rename NameDefinition -> DefinitionAleksey Kladov2020-03-031-12/+12
|
* Highlight assist testsAleksey Kladov2020-03-031-1/+1
|
* Remove stray dbgAleksey Kladov2020-03-031-2/+2
|
* More principled approach for gotodef for field shorhandAleksey Kladov2020-03-021-13/+17
| | | | | Callers can now decide for themselves if they should prefer field or local definition. By default, it's the local.
* Remove debug printAleksey Kladov2020-02-291-1/+0
|
* Correctly flag 'lifetime definitions as definitionsAleksey Kladov2020-02-281-2/+7
|
* Classify name takes const patterns into accountAleksey Kladov2020-02-281-7/+9
|
* Fix union classificationAleksey Kladov2020-02-281-1/+1
|
* Cleanup highlighting tagsAleksey Kladov2020-02-281-13/+17
|
* add more tagsAleksey Kladov2020-02-281-7/+10
|
* Refactor string literalsAleksey Kladov2020-02-271-2/+4
|
* Basic injectionsAleksey Kladov2020-02-271-4/+55
|
* Move tests to a new fileAleksey Kladov2020-02-271-134/+2
|
* More cleanupAleksey Kladov2020-02-271-114/+108
|
* Split loop into orthogonal phasesAleksey Kladov2020-02-271-44/+43
|
* CleanupAleksey Kladov2020-02-271-37/+34
|
* Minor cleanupAleksey Kladov2020-02-271-15/+18
|
* Renam moduleAleksey Kladov2020-02-271-2/+2
|
* Move html highlightig to a separate moduleAleksey Kladov2020-02-271-97/+3
|
* Fix html testsAleksey Kladov2020-02-271-6/+6
|
* Better highlightign APIAleksey Kladov2020-02-271-47/+60
|
* More type safety for highlightingAleksey Kladov2020-02-261-66/+41
|
* Refactor primary IDE APIAleksey Kladov2020-02-261-48/+39
| | | | | | | | | | This introduces the new type -- Semantics. Semantics maps SyntaxNodes to various semantic info, such as type, name resolution or macro expansions. To do so, Semantics maintains a HashMap which maps every node it saw to the file from which the node originated. This is enough to get all the necessary hir bits just from syntax.
* Rename back to highlight and check event's again highlight rangekjeremy2020-02-251-35/+51
|
* Semantic RangesJeremy Kolb2020-02-251-3/+46
|
* Teach the server about Semantic Tokens proposed LSPkjeremy2020-02-251-26/+26
|
* Merge NameDefinition and NameKindAleksey Kladov2020-02-191-22/+22
|
* Cleanup importsAleksey Kladov2020-02-181-22/+18
|
* Minor simplificationAleksey Kladov2020-02-181-6/+3
|
* Add module colors to cssAleksey Kladov2020-02-161-0/+1
|
* RenameAleksey Kladov2020-02-071-10/+10
|
* Remove irrelevant distinctionAleksey Kladov2020-02-071-3/+0
|