Commit Graph

1572 Commits

Author SHA1 Message Date
Andrew Dupont
6d36685df3 [language-ruby] Update to latest Tree-sitter Ruby parser 2024-05-05 22:45:41 -07:00
Andrew Dupont
5472e32e21 [language-sass] Force the TextMate grammar when running SassDoc specs 2024-05-05 22:45:41 -07:00
Andrew Dupont
da1912d1a7 [language-sass] Add SCSS Tree-sitter grammar 2024-05-05 22:45:41 -07:00
Maurício Szabo
9e70a723c7 Fixed tags 2024-04-30 19:06:11 -03:00
Maurício Szabo
781060e01b Adding a tags query 2024-04-30 15:35:52 -03:00
Maurício Szabo
bd5d1f69ae Fixed Javascript injections for Clojure 2024-04-30 12:32:47 -03:00
Maurício Szabo
10c6eb0b0c Adding Jank as an extension 2024-04-30 12:32:30 -03:00
Maurício Szabo
754dcf2cc3 Removed test for Jank 2024-04-30 12:31:31 -03:00
Maurício Szabo
c7d3a00bce Removed Jank injection (they changed the API) 2024-04-30 12:14:05 -03:00
Maurício Szabo
a2a6d3e67e Merge remote-tracking branch 'origin/master' into clojure-grammar-enhancements 2024-04-30 11:10:27 -03:00
confused-Techie
15dd4f29c0 Update packages info 2024-04-28 13:22:01 -07:00
confused-Techie
4f02ca3b71 Bundle snippets 2024-04-28 13:16:43 -07:00
Andrew Dupont
b1b6883c57
Merge pull request #973 from savetheclocktower/regenerate-github-css
[markdown-preview] Add dark mode for GitHub-style preview
2024-04-20 11:35:14 -07:00
confused-Techie
9f0e8a2c8a Stop detecting .org files as language-clojure 2024-04-17 19:29:57 -07:00
confused-Techie
2636f1e982 Add #935 2024-04-15 16:55:14 -07:00
confused-Techie
0c73a6cc84 Add 1.116.0 Changelog entries 2024-04-15 16:44:19 -07:00
Andrew Dupont
8b4fbbd23c Remove primer-markdown.less 2024-04-14 14:45:42 -07:00
Andrew Dupont
41d891582b
Merge pull request #968 from savetheclocktower/tree-sitter-april
Tree-sitter fixes (1.116 edition)
2024-04-14 13:19:42 -07:00
Andrew Dupont
2369395ba2 [markdown-preview] Add specs for GitHub light/dark themes 2024-04-14 12:58:52 -07:00
Andrew Dupont
596a3cd798 [markdown-preview] Add dark mode GitHub styles for Markdown…
…and the ability to choose a specific theme via a config setting (or use the system default).
2024-04-14 12:58:52 -07:00
Andrew Dupont
5d6af88dd7 [language-python] Fix highlighting of some constructors 2024-04-11 20:39:26 -07:00
Maurício Szabo
9bb403eb9a Fixes a possible performance issue 2024-04-11 22:00:13 -03:00
Andrew Dupont
03af1244d3 [language-python] Prevent type annotations from hinting at indents 2024-04-11 17:53:25 -07:00
Maurício Szabo
1027a51811 Merge remote-tracking branch 'origin/master' into clojure-grammar-enhancements 2024-04-11 21:53:18 -03:00
Andrew Dupont
035595d1c2 Add TextEditor specs for new getCommentDelimitersForPosition 2024-04-06 16:36:13 -07:00
Andrew Dupont
b9ee65f6a3 Add extensive comment delimiter metadata to most built-in grammars 2024-04-06 13:00:55 -07:00
DeeDeeG
ace4180d9f
Merge pull request #957 from pulsar-edit/rework-windows-path-modification
[core] (Windows) Remove all `Machine` PATH handling, add safety mechanisms
2024-04-06 15:41:43 -04:00
Andrew Dupont
bf62b01757 [language-typescript] Fix scopes on type annotations…
…so they don’t also apply to namespaced TSX tags.
2024-04-05 10:05:33 -07:00
Andrew Dupont
93ed91716b [language-typescript] Change scopes for template string punctuation…
…to match the names we use in JavaScript.
2024-04-04 17:20:20 -07:00
Andrew Dupont
cc42807574 [language-typescript] Add scope names to namespaced events…
…and a `meta` scope to every type annotation.
2024-04-04 17:18:18 -07:00
Andrew Dupont
27ee8b3edf [language-gfm] Fix name of modern grammar for Markdown 2024-04-04 15:59:52 -07:00
Andrew Dupont
ca0b1d7bb1 [language-typescript] Improve highlighting of TSX fragments 2024-04-03 23:41:58 -07:00
Andrew Dupont
22b27afd32 [language-(java|type)script] Highlight wildcard export specifiers…
…like `export * from 'foo'`.
2024-04-03 23:32:48 -07:00
Andrew Dupont
9583449e57 [language-gfm] Replace the modern Tree-sitter GFM grammar…
…with one based on a better parser.

The `ikatyang` parser is great… until multi-byte input comes into play, or some other construct it doesn't understand. It doesn't have any way to recover when it hits those cases; it just throws exceptions, and WASM can't catch them.

The `MDeiml` parser for Markdown had one deal-breaking issue (https://github.com/tree-sitter-grammars/tree-sitter-markdown/issues/92), and once that got solved, it emerged as the clear victor.

Several people have been using this grammar as `language-markdown-alpha` on the repository, and none of them have encountered any problems of the sort they did with the `ikatyang` parser.
2024-04-03 23:16:25 -07:00
Andrew Dupont
a8fb526fa2 [language-bash] Fix injectionRegex for bash grammar 2024-04-03 22:59:16 -07:00
confused-Techie
eda5443bda Ensure script can launch, override path values on logging, add reboot warning 2024-03-25 16:58:06 -07:00
DeeDeeG
d3853eee34 changelog: Adjust/add changelog entry for PR 956 2024-03-22 20:16:06 -04:00
confused_techie
657026a11e 1.115.0 Changelog Entries 2024-03-22 07:22:08 -07:00
Andrew Dupont
15b3a49703 [language-hyperlink] Allow includeChildren option…
…when defining hyperlink injection.
2024-03-21 16:02:51 -07:00
Andrew Dupont
4c5ef99281 [language-typescript] Add highlighting for regular expressions
(Apologies for this oversight.)
2024-03-21 16:01:32 -07:00
Maurício Szabo
ab2df0ebf1
Merge branch 'master' into tree-sitter-ruby-folds 2024-03-21 19:49:02 -03:00
Andrew Dupont
1481d392bd
Merge pull request #941 from savetheclocktower/tree-sitter-march
Tree-sitter rolling fixes: 1.115 edition
2024-03-19 18:56:08 -07:00
Andrew Dupont
6fe8e5377a Address feedback 2024-03-19 18:55:31 -07:00
confused-Techie
90d71d0391 Remove all Machine handling of path modification, ensure to safely modify path 2024-03-17 23:54:48 -07:00
Andrew Dupont
a294c88a47 [language-c] C/C++ highlighting fixes…
* GOTO labels
* Members like `foo.bar`
* Marking of constants in C++
2024-03-17 20:49:17 -07:00
Maurício Szabo
0e8a54fdaf Symbol and string arrays folds for Ruby 2024-03-16 02:27:44 -03:00
Maurício Szabo
73e9543eb7 Fixed folds for Ruby 2024-03-16 02:15:06 -03:00
Andrew Dupont
175174e05c [language-javascript] Remove stale TODO comment 2024-03-10 16:04:59 -07:00
Andrew Dupont
86cb072c54 [symbols-view] Ensure query field contents are initially selected…
…when `prefillSelectedText` is `true` and the editor has selected text when a `SelectListView` is opened.
2024-03-10 14:09:30 -07:00
Andrew Dupont
e030105820 [language-ruby] Enhancements for percent-array notation in Ruby
Fixes #945.
2024-03-09 10:33:01 -08:00
Andrew Dupont
78deb79146 [language-c] Fix issue where the wrong node gets injected into…
…in a macro definition.
2024-03-09 10:14:39 -08:00
Andrew Dupont
95ca84a58a [language-shellscript] Attempt to bump tree-sitter-bash once again 2024-03-06 23:04:06 -08:00
Dominik Schachten
59bdc8d354 Fix fs.lstatSync throws Exception if no file or dir
If it throws the Exception, other valid uris such as atom://teletype/...
will not be evaluated in the else branch
The old fs-plus did not throw.
Newer versions of fs.lstatSync allow for option parameter to control if it throws.
2024-03-05 20:43:49 +01:00
Andrew Dupont
579cc2605b [grammar-selector] Show a badge for all kinds of grammars…
…when `hideDuplicateTextMateGrammars` is `false`.
2024-03-03 21:42:18 -08:00
Andrew Dupont
e8d4e0b06d [grammar-selector] Simplify fallback options…
…when the user's preferred type of grammar isn't available for a particular language.
2024-03-03 00:11:25 -08:00
Andrew Dupont
b9258b5884 [grammar-selector] Overhaul grammar display:
* When set to `true`, `hideDuplicateTextMateGrammars` will hide all grammars except whichever one the user has indicated a preference for — via `useTreeSitterParsers` and `useLegacyTreeSitter` settings, whether global or scope-specific.

* When set to `false`, `hideDuplicateTextMateGrammars` will show all grammars, even Legacy Tree-sitter.
2024-03-02 20:55:02 -08:00
Andrew Dupont
2827e6a4c4 [language-typescript] Add cts(x)/mts(x) to the file extensions lists 2024-03-01 15:43:49 -08:00
Andrew Dupont
0cea2667a8 [language-typescript] Highlighting fixes…
* Add scopes for unary arithmetic operators (`+`, `-`)
* Ensure that function parameters set `capture.final`
2024-02-17 22:19:44 -08:00
Maurício Szabo
444e400e90 Fixes on Clojure extension types 2024-02-17 22:20:51 -03:00
confused_techie
e2a1209502
Merge pull request #927 from pulsar-edit/1.114.0-changelog
1.114.0 Changelog
2024-02-15 19:57:50 -08:00
confused-Techie
02f6a45944 Add github summary change 2024-02-15 19:56:48 -08:00
confused-Techie
8052078d60 Manually add summary items 2024-02-15 18:34:36 -08:00
confused-Techie
299cc9c5ea Removed Rolling Release notes
These don't make much sense for the summary section, as pointed out on Discord
2024-02-15 18:25:41 -08:00
confused-Techie
b1a2187fd3 Add Changelog entries for 1.114.0 2024-02-15 17:33:10 -08:00
Andrew Dupont
325b6b6b1e [symbols-view] Remap go-to-declaration commands on Windows/Linux 2024-02-15 14:23:41 -08:00
Andrew Dupont
ec12b2f0af
Merge pull request #906 from savetheclocktower/tree-sitter-february
Tree-sitter rolling fixes (February)
2024-02-14 21:30:09 -08:00
Andrew Dupont
114a7247de
Merge pull request #861 from savetheclocktower/symbols-view-fixes
`symbols-view` rolling fixes
2024-02-14 21:29:31 -08:00
Andrew Dupont
82eac2276d [language-typescript] Add syntax highlighting for enums 2024-02-09 22:33:48 -08:00
Andrew Dupont
89686ce03a [language-html] Allow for folding of attribute lists…
…such as in multi-line self-closing tags and multi-line opening tags.

Also fix an issue in fold handling that made it impossible to use `@_IGNORE_` captures in `folds.scm`.
2024-02-09 14:20:34 -08:00
Andrew Dupont
cc20d7055d [language-html] Fix indentation after self-closing tags 2024-02-09 09:51:41 -08:00
Andrew Dupont
7dbbd7afda
Update packages/command-palette/lib/command-palette-view.js
Co-authored-by: Maurício Szabo <mauricioszabo@users.noreply.github.com>
2024-02-09 09:17:25 -08:00
Andrew Dupont
2c5be1eda9 [command-palette] Guard against failure to highlight a match 2024-02-08 19:44:02 -08:00
Andrew Dupont
e332953260 [language-c] Add missing anchor to constant pattern 2024-02-04 13:36:17 -08:00
Andrew Dupont
cb7d4aad6c [language-c] C/C++ highlighting fixes…
Changes: 

* `#define FOO 1` and `#define FOO` will _always_ scope `FOO` as `constant.other.c`, even when `FOO` is mixed-case or lower-case.
* `#define FOO()` will _always_ scope `FOO` as `entity.name.function.preprocessor.c`, even when `FOO` is mixed-case or lower-case.
* Usages of bare identifiers in other contexts in preprocessor directives should always scope them as `constant.other.c` — unless I’m made aware of any counterexamples where that shouldn’t happen. For example: in `#if TABLE_SIZE > 200`, `TABLE_SIZE` should always be `constant.other.c`, no matter its casing.
* All-caps variable declarations and assignments (`int FOO = 0`, etc.) should scope `FOO` as `variable` rather than `constant`. We should only scope an arbitrary identifier as `constant` if we think it’s been used in the context of a macro definition.

However:

* When deciding whether something outside of a directive refers to a macro constant, we have no choice but to use the `ALL_CAPS` heuristic. Ideally we’d be able to determine that from some sort of analysis of the source code files — but even if we could keep track of that sort of thing in a single buffer, it’d fall down when macro constants _defined in other files_ are used. All we can do here is make a best guess.
2024-02-03 23:39:12 -08:00
Andrew Dupont
10ce3b11a1 Forgot to bump parserSource (the system works!) 2024-02-02 23:57:21 -08:00
Andrew Dupont
3131464ddb [language-php] Update tree-sitter-phpdoc
…and add some `punctuation` scopes for the generic type delimiters.
2024-02-02 23:07:34 -08:00
Andrew Dupont
32c464b3cb [language-typescript] Highlight escape characters 2024-02-01 21:35:07 -08:00
Andrew Dupont
982917803e [language-php] Fix block comments failing to re-highlight 2024-02-01 21:35:07 -08:00
Andrew Dupont
b3b16010fa [settings-view] Don’t display heading anchor icons within a README 2024-01-31 23:05:18 -08:00
Andrew Dupont
2e36a24fc6 [language-php] Remove firstLineRegex and contentRegex
They don’t gain us anything, and in fact actually cause this grammar to be ranked _below_ the TextMate PHP grammar when they fail.
2024-01-29 18:51:35 -08:00
Andrew Dupont
05de7dba2c [symbols-view] Forgot this part. 2024-01-29 00:56:32 -08:00
Andrew Dupont
51f06683f6 [symbols-view] Implement “prefill with selected text”
When enabled, will use the selected text in your editor as the search query in the symbols list.

Prefers an empty string if the setting is disabled, or if the editor selection spans more than one buffer line.
2024-01-29 00:53:42 -08:00
Andrew Dupont
67e41a1f11 [symbols-view] Infer icons from tag if icon is not present
This should result in _lots_ more icons in the symbols list.
2024-01-28 23:43:21 -08:00
Andrew Dupont
8be56e2559 [symbols-view] Guard against error during teardown…
…that can happen if the broker is destroyed before the providers.
2024-01-28 23:43:21 -08:00
Andrew Dupont
db1a4c50a4 [language-php] Update tags.scm 2024-01-28 23:43:21 -08:00
Andrew Dupont
3565ea822e [symbol-provider-tree-sitter] Add specs for context, tag, icon 2024-01-28 23:43:21 -08:00
Andrew Dupont
58d9a0393e [symbol-provider-tree-sitter] Fix icon display via symbol.icon
Specifying the icon via the `(#set! symbol.icon "foo")` predicate was having no effect.
2024-01-28 23:43:21 -08:00
Andrew Dupont
33b4eea80d Align icons better alongside symbol names 2024-01-28 23:43:21 -08:00
Andrew Dupont
8799fb053b Flesh out service documentation 2024-01-28 23:43:21 -08:00
Andrew Dupont
94d41ce82b [language-(java|type)script] Highlight array-destructured variables…
…no matter how deeply they’re nested.

Also highlight `?` in an incomplete ternary.

(Also fix a lot of final segments in the TypeScript highlights file; I’ve been lazily copying-and-pasting and forgetting to change them.)
2024-01-28 11:45:36 -08:00
Andrew Dupont
e49b919703 [language-(java|type)script] Add exhaustive indentation configuration
We are crossing the Rubicon.

https://github.com/orgs/pulsar-edit/discussions/249 is a discussion of specific ways that indentation is different in JavaScript because of the new grammar. We intentionally didn’t try to preserve the indentation decisions in the old TextMate grammar, but this is (predictably) disruptive to some people. We don’t want to punt like legacy Tree-sitter did and rely on the TextMate grammar’s coarse regexes to decide what gets indented, but we can at least make the new indentation system granularly configurable.

This commit makes practically every indentation decision configurable in JavaScript and TypeScript. It groups these settings under a new “Indentation” section in each package’s settings.

I might decide that this goes too far and roll back the granular settings for `{`, `[`, and `(`, but the other indentation hints are absolutely matters of taste, so it’s only proper that users can choose to disable them.

In the long run, we could _consider_ allowing users to swap in another indentation engine altogther, much like #895 proposes for folds. That would let us legitimately offer users a way to opt into “the way the TextMate grammar does it” without affecting other users.

Another stopgap option would be to add a way for a user to disable indentation hinting altogether for a given grammar.
2024-01-28 11:21:59 -08:00
Andrew Dupont
e547ace81c [language-css] Highlighting fixes:
* Style `*` (universal selector)
* Add support for namespaced tags and attributes (now that `tree-sitter-css` supports them)
2024-01-27 20:23:42 -08:00
Andrew Dupont
a8215f107c [language-java] Add highlights for variables…
…when assigning, reassigning, or incrementing.

Also add `++` and `--` as operators.
2024-01-27 18:13:42 -08:00
Andrew Dupont
1f9ab2008b [language-javascript] Highlight public fields in class bodies 2024-01-27 11:31:25 -08:00
Andrew Dupont
adfdd05472 Allow “half-covering” of scopes at the edges of injections
There's a hard-to-grok setting for language injections that allows a deeper layer to monopolize the scope application for a range. In most cases, an injection is placed into a node that the parser doesn't know much about (like a `script` block in HTML); but Rust and C parsers needed a way to inject themselves _into themselves_ so that they could add syntax highlighting to macros. Because they were applying highlighting to a range that the base layer _already_ had plans to highlight, they needed a way to block the shallower layer from acting.

This mode has never worked briliantly, but it's been made smarter in several ways since the invention of modern Tree-sitter. And here's another one: if the highlight iterator is at a position where an injection range is _about_ to begin, it shouldn't be able to stop any other layer from _closing_ a scope; and if the highlight iterator is at a position where an injection range has just _finished_, it shouldn't be able to stop any other layer from _opening_ a scope.

Because of this, we can now fix a bug that I think might've been present for a while in the application of scopes to rust macros like `println!` — the position after the exclamation point is one of those injection-layer boundaries, to the effect that a scope name was opened that would persist until at least the end of the screen line.
2024-01-27 00:41:41 -08:00
Andrew Dupont
5728b7fe5e [language-javascript] Update to latest tree-sitter-jsdoc 2024-01-26 23:12:02 -08:00
Andrew Dupont
483870d701 [language-rust] Scope &s in references as operators 2024-01-26 23:11:11 -08:00
Andrew Dupont
312f627cc1 [language-yaml] Scope unquoted strings as, well, string.unquoted 2024-01-26 23:10:37 -08:00
Andrew Dupont
ff030d896c [language-javascript] Missed these renames 2024-01-26 18:19:48 -08:00
Andrew Dupont
476e784005 [language-javascript] Two highlighting fixes…
* Revert JSDoc tags to use the `keyword` namespace
* Ensure we always apply `meta.tag.jsx.js` to the area surrounding a JSX opening/closing/self-closing tag element and its punctuation.
2024-01-26 17:26:37 -08:00