Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

Tokenize functions parameters - #64

Closed
MaximSokolov wants to merge 5 commits into
atom:masterfrom
MaximSokolov:fix-parameters
Closed

MaximSokolov wants to merge 5 commits into
atom:masterfrom
MaximSokolov:fix-parameters

Conversation

@MaximSokolov

Copy link
Copy Markdown

Fixes #63

I couldn't make it work for functions
with multiline parameters:

(param1
  param2) -> x * x

with function-calls:

(bar, bar2=test()) ->

@MaximSokolov

Copy link
Copy Markdown
Author

I've changed @param scope to 'variable.parameter.function.readwrite.instance.coffee'

@winstliu

Copy link
Copy Markdown
Contributor

Does this still have the problems listed in your original comment?

@MaximSokolov

Copy link
Copy Markdown
Author

Yes:

atom-text-editor::shadow {
  .variable.parameter {
    color: red;
  }
}
test = (x1, x2) -> x1 * x2

test = (x1, x2=test()) -> x1 * x2

test = (x1,
        x2) -> x1 * x2

Before:
coffee1

After:
coffee2

(?x) Permits whitespace in pattern
Still does't match parameters
in multiline functions:

(param1,
  param2) ->

with function calls:

(param=test()) ->
'name': 'variable.parameter.function.coffee'
'3':
'name': 'punctuation.separator.parameters.coffee'
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you should reuse more from 'repository' with { 'include': '#...' } expressions in patterns

@MaximSokolov MaximSokolov mentioned this pull request Oct 10, 2016
4 of 6 tasks
@MaximSokolov

Copy link
Copy Markdown
Author

Superseded by #103

@MaximSokolov
MaximSokolov deleted the fix-parameters branch July 6, 2017 17:49
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants