Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into feature/latest-elec…
Browse files Browse the repository at this point in the history
…tron-native-superstring
  • Loading branch information
mauricioszabo committed Mar 15, 2024
2 parents dc317b7 + 7d2d876 commit 5511320
Show file tree
Hide file tree
Showing 33 changed files with 1,081 additions and 200 deletions.
7 changes: 4 additions & 3 deletions .cirrus.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
env:
PYTHON_VERSION: 3.12
GITHUB_TOKEN: ENCRYPTED[!af8c6a449b6ff0a381ac6dd267d664a9e5d3551cbc9922aa98f806a0c881e10f47565f915dc277dd3f5c7cdf47f09d1b!]
GITHUB_TOKEN: ENCRYPTED[!c394f11378a8bc92ff1b05662ee3e574fc662692e45f0a048aa8cab42fb072b039d83f68fd6953f470af51846063ce46!]
# The above token, is a GitHub API Token, that allows us to download RipGrep without concern of API limits

# linux_task:
Expand Down Expand Up @@ -63,7 +63,7 @@ arm_linux_task:
memory: 8G
env:
USE_SYSTEM_FPM: 'true'
ROLLING_UPLOAD_TOKEN: ENCRYPTED[e954268e0b8e724deab26a68557eb6310dec58d02b319a582214a37687ef86f47a4b83d71c4e3aa4f2bbdf542180b2d3]
ROLLING_UPLOAD_TOKEN: ENCRYPTED[e19187268935fd1a2e1db3304105cc4bf37d5f5a46ba519a1b952f8ac9a3d01982fa9b8274b838547aa37920774b7518]
prepare_script:
- apt-get update
- export DEBIAN_FRONTEND="noninteractive"
Expand All @@ -85,6 +85,7 @@ arm_linux_task:
libasound2-dev
libnss3
xvfb
- gem install dotenv -v '~> 2.8'
- gem install fpm
- git submodule init
- git submodule update
Expand Down Expand Up @@ -130,7 +131,7 @@ silicon_mac_task:
APPLEID: ENCRYPTED[549ce052bd5666dba5245f4180bf93b74ed206fe5e6e7c8f67a8596d3767c1f682b84e347b326ac318c62a07c8844a57]
APPLEID_PASSWORD: ENCRYPTED[774c3307fd3b62660ecf5beb8537a24498c76e8d90d7f28e5bc816742fd8954a34ffed13f9aa2d1faf66ce08b4496e6f]
TEAM_ID: ENCRYPTED[11f3fedfbaf4aff1859bf6c105f0437ace23d84f5420a2c1cea884fbfa43b115b7834a463516d50cb276d4c4d9128b49]
ROLLING_UPLOAD_TOKEN: ENCRYPTED[e954268e0b8e724deab26a68557eb6310dec58d02b319a582214a37687ef86f47a4b83d71c4e3aa4f2bbdf542180b2d3]
ROLLING_UPLOAD_TOKEN: ENCRYPTED[e19187268935fd1a2e1db3304105cc4bf37d5f5a46ba519a1b952f8ac9a3d01982fa9b8274b838547aa37920774b7518]
prepare_script:
- brew update
- brew install node@16 yarn git python@$PYTHON_VERSION
Expand Down
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
*.ts
vendor
39 changes: 39 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,45 @@

## [Unreleased]

## 1.114.0

- Prevented an exception raised in the command palette in certain unusual filtering scenarios.
- Refrain from rendering anchor icons when showing a package's README file in `settings-view`.
- Build Linux binaries on Debian 10, for older glibc and compatibility with older Linux distros.
- Fixed a rendering error in `atom.ui.markdown.render` when `disableMode` was set to `"strict"` and the input contained HTML line breaks.
- Added support for the semanticolor package in modern tree-sitter grammars.
- Added new `--force` flag to `ppm link` command that will uninstall any conflicting package already installed.
- Added language entity colors to `syntax-variables.less`.
- Numerous Tree-Sitter Grammar syntax highlighting fixes.
- Bumped dugite to make the github package compatible with ARM Linux.

### Pulsar
- Fixed: fix(tree-sitter): pass node text to grammar [@claytoncarter](https://github.com/pulsar-edit/pulsar/pull/860)
- Fixed: Fix issue with Markdown rendering after line break in strict mode [@savetheclocktower](https://github.com/pulsar-edit/pulsar/pull/889)
- Updated: Update README badges [@Daeraxa](https://github.com/pulsar-edit/pulsar/pull/891)
- Updated: Update copyright year to 2024 [@Daeraxa](https://github.com/pulsar-edit/pulsar/pull/870)
- Added: CI: build Linux x86-64 binaries on older Linux [@DeeDeeG](https://github.com/pulsar-edit/pulsar/pull/858)
- Fixed: Tree-sitter rolling fixes (January edition) [@savetheclocktower](https://github.com/pulsar-edit/pulsar/pull/859)
- Fixed: Fix failing spec [@savetheclocktower](https://github.com/pulsar-edit/pulsar/pull/902)
- Fixed: [settings-view] Don't display heading anchor icons within a README [@savetheclocktower](https://github.com/pulsar-edit/pulsar/pull/905)
- Updated: ppm: Update ppm to commit 241d794f326b63b5abdb9769 [@DeeDeeG](https://github.com/pulsar-edit/pulsar/pull/908)
- Fixed: script: Update version check in Rolling release binary upload script to exclude '-dev' versions [@DeeDeeG](https://github.com/pulsar-edit/pulsar/pull/903)
- Fixed: CI: Fix tag Linux binaries are uploaded to for Rolling [@DeeDeeG](https://github.com/pulsar-edit/pulsar/pull/901)
- Fixed: [command-palette] Guard against failure to highlight a match [@savetheclocktower](https://github.com/pulsar-edit/pulsar/pull/913)
- Fixed: `symbols-view` rolling fixes [@savetheclocktower](https://github.com/pulsar-edit/pulsar/pull/861)
- Fixed: Tree-sitter rolling fixes (February) [@savetheclocktower](https://github.com/pulsar-edit/pulsar/pull/906)
- Updated: [meta] Update Cirrus `GITHUB_TOKEN` [@confused-Techie](https://github.com/pulsar-edit/pulsar/pull/924)
- Updated: deps: Update github to v0.36.20-pretranspiled to bump dugite [@DeeDeeG](https://github.com/pulsar-edit/pulsar/pull/925)
- Fixed: [symbols-view] Remap go-to-declaration commands on Windows/Linux [@savetheclocktower](https://github.com/pulsar-edit/pulsar/pull/926)

### PPM
- Fixed: Fix test failure due to missing atom command [@toddy15](https://github.com/pulsar-edit/ppm/pull/124)
- Updated: Update syntax-variables.less to include language entity colors [@savetheclocktower](https://github.com/pulsar-edit/ppm/pull/123)
- Added: feat(link): add --force flag [@claytoncarter](https://github.com/pulsar-edit/ppm/pull/122)

### github
- Updated: Bump dugite to 2.5.2 [@DeeDeeG](https://github.com/pulsar-edit/github/pull/39)

## 1.113.0

- Enabled Modern Tree-sitter Grammars by default
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "pulsar",
"author": "Pulsar-Edit <admin@pulsar-edit.dev>",
"productName": "Pulsar",
"version": "1.113.0-dev",
"version": "1.114.0-dev",
"description": "A Community-led Hyper-Hackable Text Editor",
"branding": {
"id": "pulsar",
Expand Down Expand Up @@ -216,7 +216,7 @@
"exception-reporting": "file:./packages/exception-reporting",
"find-and-replace": "file:./packages/find-and-replace",
"fuzzy-finder": "file:packages/fuzzy-finder",
"github": "0.36.19",
"github": "0.36.20",
"git-diff": "file:./packages/git-diff",
"go-to-line": "file:./packages/go-to-line",
"grammar-selector": "file:./packages/grammar-selector",
Expand Down
86 changes: 69 additions & 17 deletions packages/language-c/grammars/tree-sitter-c/highlights.scm
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

; PREPROCESSOR
; ============

Expand All @@ -16,21 +17,48 @@
(["#if" "#ifdef" "#ifndef" "#endif" "#elif" "#else" "#define" "#include"] @punctuation.definition.directive.c
(#set! adjust.endAfterFirstMatchOf "^#"))


; This will match if the more specific rules above haven't matched. The
; anonymous nodes will match under ideal conditions, but might not be present
; if the parser is flummoxed.
; `preproc_directive` will be used when the parser doesn't recognize the
; directive as one of the above. It's permissive; `#afdfafsdfdfad` would be
; parsed as a `preproc_directive`.
;
; Hence this rule will match if the more specific rules above haven't matched.
; The anonymous nodes will match under ideal conditions, but might not be
; present even when they ought to be _if_ the parser is flummoxed; so this'll
; sometimes catch `#ifdef` and others.
((preproc_directive) @keyword.control.directive.c
(#set! capture.shy true))

((preproc_ifdef
(identifier) @entity.name.function.preprocessor.c
(#match? @entity.name.function.preprocessor.c "[a-zA-Z_$][\\w$]*")))
((preproc_directive) @punctuation.definition.directive.c
(#set! capture.shy true)
(#set! adjust.endAfterFirstMatchOf "^#"))

; Macro functions are definitely entities.
(preproc_function_def
(identifier) @entity.name.function.preprocessor.c
(#set! capture.final true))

; Identifiers in macro definitions are definitely constants.
((preproc_def
name: (identifier) @constant.preprocessor.c))

; We can also safely treat identifiers as constants in `#ifdef`…
((preproc_ifdef
(identifier) @constant.preprocessor.c))

; …and `#if` and `#elif`…
(preproc_if
(binary_expression
(identifier) @constant.preprocessor.c))
(preproc_elif
(binary_expression
(identifier) @constant.preprocessor.c))

; …and `#undef`.
((preproc_call
directive: (preproc_directive) @_IGNORE_
argument: (preproc_arg) @constant.preprocessor.c)
(#eq? @_IGNORE_ "#undef"))

(system_lib_string) @string.quoted.other.lt-gt.include.c
((system_lib_string) @punctuation.definition.string.begin.c
(#set! adjust.endAfterFirstMatchOf "^<"))
Expand All @@ -48,6 +76,15 @@
(#set! capture.final true))

(primitive_type) @support.storage.type.builtin.c

; When the user has typed `#define FOO`, the macro injection thinks that `FOO`
; is a type declaration (for some reason). This node structure seems to exist
; only in that unusual and incorrect scenario, so we'll stop it from happening
; so that it doesn't override the underlying `constant.other.c` scope.
(translation_unit
(type_identifier) @_IGNORE_
(#set! capture.final))

(type_identifier) @support.other.storage.type.c

; These types are all reserved words; if we see an identifier with this name,
Expand Down Expand Up @@ -133,27 +170,31 @@

; The "x" in `int x;`
(declaration
declarator: (identifier) @variable.declaration.c)
declarator: (identifier) @variable.other.declaration.c)

; The "x" in `int x = y;`
(init_declarator
declarator: (identifier) @variable.declaration.c)
declarator: (identifier) @variable.other.declaration.c)

; The "x" in `SomeType *x;`
; (Should work no matter how many pointers deep we are.)
(pointer_declarator
declarator: [(identifier) (field_identifier)] @variable.declaration.pointer.c
declarator: [(identifier) (field_identifier)] @variable.other.declaration.pointer.c
(#is? test.descendantOfType "declaration field_declaration"))

; An array declarator: the "table" in `int table[4];`
(array_declarator
declarator: (identifier) @variable.other.declaration.c)

; A member of a struct.
(field_declaration
(field_identifier) @variable.declaration.member.c)
(field_identifier) @variable.other.declaration.member.c)

; An attribute in a C99 struct designated initializer:
; the "foo" in `MY_TYPE a = { .foo = true };
(initializer_pair
(field_designator
(field_identifier) @variable.declaration.member.c))
(field_identifier) @variable.other.declaration.member.c))

; (and the associated ".")
(initializer_pair
Expand All @@ -162,15 +203,15 @@

(field_declaration
(pointer_declarator
(field_identifier) @variable.declaration.member.c))
(field_identifier) @variable.other.declaration.member.c))

(field_declaration
(array_declarator
(field_identifier) @variable.declaration.member.c))
(field_identifier) @variable.other.declaration.member.c))

(init_declarator
(pointer_declarator
(identifier) @variable.declaration.member.c))
(identifier) @variable.other.declaration.member.c))

; The "x" in `x = y;`
(assignment_expression
Expand Down Expand Up @@ -253,8 +294,19 @@
(false)
] @constant.language._TYPE_.c

((identifier) @constant.c
(#match? @constant.c "[_A-Z][_A-Z0-9]*$"))
; Don't try to scope (e.g.) `int FOO = 1` as a constant when the user types `=`
; but has not typed the value yet.
(ERROR
(identifier) @_IGNORE_
(#set! capture.final))

; In most languages we wouldn't be making the assumption that an all-caps
; identifier should be treated as a constant. But those languages don't have
; macro preprocessors. The convention is decently strong in C/C++ that all-caps
; identifiers will refer to `#define`d things.
((identifier) @constant.other.c
(#match? @constant.other.c "^[_A-Z][_A-Z0-9]*$")
(#set! capture.shy))


; COMMENTS
Expand Down
82 changes: 61 additions & 21 deletions packages/language-c/grammars/tree-sitter-cpp/highlights.scm
Original file line number Diff line number Diff line change
Expand Up @@ -13,33 +13,55 @@
"#define" @keyword.control.directive.define.cpp
"#include" @keyword.control.directive.include.cpp

(["#if" "#ifdef" "#ifndef" "#endif" "#elif" "#else" "#define" "#include"] @punctuation.definition.directive.c
(["#if" "#ifdef" "#ifndef" "#endif" "#elif" "#else" "#define" "#include"] @punctuation.definition.directive.cpp
(#set! adjust.endAfterFirstMatchOf "^#"))


; This will match if the more specific rules above haven't matched. The
; anonymous nodes will match under ideal conditions, but might not be present
; if the parser is flummoxed.
((preproc_directive) @keyword.control.directive.c
; `preproc_directive` will be used when the parser doesn't recognize the
; directive as one of the above. It's permissive; `#afdfafsdfdfad` would be
; parsed as a `preproc_directive`.
;
; Hence this rule will match if the more specific rules above haven't matched.
; The anonymous nodes will match under ideal conditions, but might not be
; present even when they ought to be _if_ the parser is flummoxed; so this'll
; sometimes catch `#ifdef` and others.
((preproc_directive) @keyword.control.directive.cpp
(#set! capture.shy true))

((preproc_ifdef
(identifier) @entity.name.function.preprocessor.c
(#match? @entity.name.function.preprocessor.c "[a-zA-Z_$][\\w$]*")))
((preproc_directive) @punctuation.definition.directive.cpp
(#set! capture.shy true)
(#set! adjust.endAfterFirstMatchOf "^#"))

; Macro functions are definitely entities.
(preproc_function_def
(identifier) @entity.name.function.preprocessor.c
(identifier) @entity.name.function.preprocessor.cpp
(#set! capture.final true))

(preproc_function_def
(identifier) @entity.name.function.preprocessor.cpp
(#set! capture.final true)
)
; Identifiers in macro definitions are definitely constants.
((preproc_def
name: (identifier) @constant.preprocessor.cpp))

(system_lib_string) @string.quoted.other.lt-gt.include.c
((system_lib_string) @punctuation.definition.string.begin.c
; We can also safely treat identifiers as constants in `#ifdef`…
((preproc_ifdef
(identifier) @constant.preprocessor.cpp))

; …and `#if` and `#elif`…
(preproc_if
(binary_expression
(identifier) @constant.preprocessor.cpp))
(preproc_elif
(binary_expression
(identifier) @constant.preprocessor.cpp))

; …and `#undef`.
((preproc_call
directive: (preproc_directive) @_IGNORE_
argument: (preproc_arg) @constant.preprocessor.cpp)
(#eq? @_IGNORE_ "#undef"))

(system_lib_string) @string.quoted.other.lt-gt.include.cpp
((system_lib_string) @punctuation.definition.string.begin.cpp
(#set! adjust.endAfterFirstMatchOf "^<"))
((system_lib_string) @punctuation.definition.string.end.c
((system_lib_string) @punctuation.definition.string.end.cpp
(#set! adjust.startBeforeFirstMatchOf ">$"))


Expand All @@ -52,6 +74,13 @@
(type_identifier) @_IGNORE_
(#set! capture.final true))

; When the user has typed `#define FOO`, the macro injection thinks that `FOO`
; is a type declaration (for some reason). This node structure seems to exist
; only in that unusual and incorrect scenario, so we'll stop it from happening
; so that it doesn't override the underlying `constant.other.c` scope.
(translation_unit
(type_identifier) @_IGNORE_
(#set! capture.final))

(primitive_type) @support.type.builtin.cpp

Expand Down Expand Up @@ -232,7 +261,7 @@
; The "x" in `SomeType *x;`
; (Should work no matter how many pointers deep we are.)
(pointer_declarator
declarator: [(identifier) (field_identifier)] @variable.declaration.pointer.c
declarator: [(identifier) (field_identifier)] @variable.declaration.pointer.cpp
(#is? test.descendantOfType "declaration field_declaration"))

; A member of a struct.
Expand Down Expand Up @@ -289,7 +318,7 @@
; The "foo" in `const char *foo` within a parameter list.
; (Should work no matter how many pointers deep we are.)
(pointer_declarator
declarator: [(identifier) (field_identifier)] @variable.parameter.pointer.c
declarator: [(identifier) (field_identifier)] @variable.parameter.pointer.cpp
(#is? test.descendantOfType "parameter_declaration"))

(parameter_declaration
Expand Down Expand Up @@ -332,8 +361,19 @@
(false)
] @constant.language._TYPE_.cpp

((identifier) @constant.cpp
(#match? @constant.cpp "[_A-Z][_A-Z0-9]*$"))
; Don't try to scope (e.g.) `int FOO = 1` as a constant when the user types `=`
; but has not typed the value yet.
(ERROR
(identifier) @_IGNORE_
(#set! capture.final))

; In most languages we wouldn't be making the assumption that an all-caps
; identifier should be treated as a constant. But those languages don't have
; macro preprocessors. The convention is decently strong in C/C++ that all-caps
; identifiers will refer to `#define`d things.
((identifier) @constant.other.cpp
(#match? @constant.other.cpp "[_A-Z][_A-Z0-9]*$")
(#set! capture.shy))


; COMMENTS
Expand Down
Loading

0 comments on commit 5511320

Please sign in to comment.