aerobounce / Swift-Next

Swift syntax package in async/await era, with extra features, for Sublime Text.
MIT License
37 stars 6 forks source link

[Syntax] Function is not recognized after variable declaration without type annotation #4

Open blach opened 11 months ago

blach commented 11 months ago

Describe the syntax error There is a syntax error when a variable declaration is not followed by a type annotation. A function declaration after such a variable declartion is not recognized.

Consider this example:

@Environment(\.dynamicTypeSize) var dynamicTypeSize

func subtitle() -> LocalizedStringKey {

In this case, the func keyword is not recognized. It gets the scope variable.other.swift instead of keyword.declaration.function.swift.

This is how it looks in Sublime Text:

Bildschirmfoto 2023-09-19 um 11 53 12

Expected behavior The function should be recognized even if there is no type annotation in the previous variable declaration.

This is how it should look:

Bildschirmfoto 2023-09-19 um 11 55 37

Minimum Reproducible Snippet of Swift code

@Environment(\.dismiss) var dismiss

func test() {

Environment (please complete the following information):

Additional context I think this can be fixed by adding - include: reserved-word-pop to declaration-variable: and declaration-constant:.