New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Annotated highlights work in Color Settings Page #320
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
When EscapeSequence were converted from tokens to elements, their highlighting was lost, so restore it by adding an annotator for EscapeSequence elements.
Helps limit errors in example text to only until the following tokens: * \n * \r\n * >> * ] * } * ) * ; * end
I'm not sure why this wasn't triggered before when testing elixir-lang/elixir, but the pygment example text did trigger that this was missing.
It was still using the pre-1.0 list syntax.
Occurs when typing `Alias.` on the `.`.
In a script file where the parent of a Match is a PsiFile, the Match useScope is the Match and the rest of the file.
Use same algorithm for ElixirStabBody and ElixirFile because they are sequences of expressions.
Atom keywords are `false`, `nil`, and `true`. If both only use foreground color, keyword wins.
Matches how Rubymine does highlighting for JSON hashes.
Matches Java
{ and } are highlighted as Braces and Operators > Braces to match Java.
Also make it derive from BRACES because {} is used for interpolation. Key is left as ELIXIR_EXPRESSION_SUBSTITUTION_MARK for any saved themes.
Don't have TextAttributeKeys for Kernel Functions, Kernel Macros, and Kernel.SpecialForms Macros, instead have Calls/Function, Calls/Predefined, and Calls/Macro. Then, Kernel Functions => Calls/Function+Calls/Predefined, Kernel Macros and Kernel.SpecialForms Macros => Calls/Macro+Calls/Predefined. Having so many highlighters now revealed a bug that the Kernel annotator highlighted the entire call, not just the function name element, so it was miss highlighting everything in the body of a `def` or `defmodule` that didn't have another highlighter that won.
Not sure why it wasn't already in there.
Occurs when the `::` has no proper right operand and the following one-liner function clause with `do:` is parsed as the right operand.
Prevents walking through errors.
Uses the Normalized pattern used for Infix.
If `<%=` from EEX is detected, don't throw error when Modular can't be found.
KronicDeth
added a commit
that referenced
this pull request
Jun 12, 2016
KronicDeth
added a commit
that referenced
this pull request
Jun 14, 2016
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Changelog
Enhancements
Alias
Braces and Operators
Bit
(<<
and>>
)Braces
({
and}
)Brackets
([
and]
)Char Tokens
(?
)Comma
(,
)Dot
(.
)Interpolation
(#{
and}
)Maps and Structs
Maps
(%{
and}
)Structs
(%{
and}
when used for struct. The Alias is still highlighted usingAlias
)Operation Sign
Parentheses
((
and)
)Semicolon
(;
)Calls
Function
(currently only combined withPredefined
to highlightKernel
functions. Will be used later for all function calls once function references are implemented.)Macro
(curently only combined withPredefined
to highlightKernel
andKernel.SpecialForms
macros. Will be used later for all macro calls once macro references are implemented.)Predefined
(Combined withFunction
to highlightKernel
functions. Combined withMacro
to highlightKernel
andKernel.SpecialForms
macros.)Escape Sequence
Module Attributes
Documentation
(PreviouslyDocumentation Module Attributes
)Text
(PreviouslyDocumentation Text
)Types
Callback
(my_callback
in@callback my_callback() :: :ok
ormy_macro_callback
in@macrocallback my_macro_callback
)Specification
(my_function
in@spec my_function() :: :ok
)Type
typ
andinteger
in@type typ :: integer
parameterized
in@type parameterized(type_parameter) :: type_parameter
typtyp
in@opaque typtyp :: 1..10
typ
andtyptyp
in@callback func(typ, typtyp) :: :ok | :fail
binary and
utf8in
<< "hello" :: binary, c :: utf8, x = 4 * 2 >> = "hello™1"`Type Parameters
(type_parameter
in@type parameterized(type_parameter) :: type_parameter
)Numbers
Binary, Decimal, Hexadecimal, and Octal Digits
(Previously at top-level.)Decimal Exponent, Mark and Separator
(Previously at top-level)Invalid Binary, Decimal, Hexadecimal, and Octal Digits
(Previously at top-level.)Non-Decimal Base Prefix
(Previously at top-level.)Obsolete Non-Decimal Base Prefix
Variables
Ignored
Parameter
Variable
\n
\r\n
>>
]
}
)
;
->
end
after
catch
else
rescue
-
to separate segment options instead of a list.)ElixirStabBody
andElixirFile
because they are sequences of expressions.false
,nil
, andtrue
) as merge ofAtom
andKeyword
text attributes. If both only use foreground color,Keyword
wins.QualifiableAlias
asAlias
.<key>:
) asAtom
.with
to highlighted special formsBug Fixes
PsiLeafElement
when looking for variables because thePsiLeafElement
is an error.Match
is aPsiFile
, theMatch
Use Scope is the rest of the file.=
toOperator Signs
NoParenthesesKeywords
when highlighting types, which occurs when the::
has no proper right operand and the following one-liner function clause withdo:
is parsed as the right operand.DUMMY_BLOCK
when looking for Variable, which prevents walking through errors.Normalized
pattern forPrefix
, so that the operand isnull
when only the operator matches or the operand has errors.<%=
from EEX is detected, don't throw error whenModular
can't be found.Incompatible Changes
Documentation Module Attributes
renamed toModule Attributes
>Documentation
Documentation Text
renamed toModule Attributes > Documentation > Text
Expression Substitution Mark
renamed toBraces and Operators > Interpolation
.Numbers
instead of being at the top-level:Binary, Decimal, Hexadecimal, and Octal Digits
Decimal Exponent, Mark and Separator
Invalid Binary, Decimal, Hexadecimal, and Octal Digits
Non-Decimal Base Prefix
Obsolete Non-Decimal Base Prefix