Skip to content
This repository has been archived by the owner on Apr 1, 2020. It is now read-only.

[WIP] Feature/token color trie #2621

Open
wants to merge 38 commits into
base: master
Choose a base branch
from

Conversation

akinsho
Copy link
Member

@akinsho akinsho commented Oct 7, 2018

Based off of #2565 this PR introduces a trie data structure to handle tokens read in from the theme, inspired by this vscode strategy
The reasoning being in summary, a trie allows us to resolve the complicated inheritance like pattern for tokens which is how textmate/vscode reads in themes e.g. if string is => { color: red, style: italic } and string.quoted is => { color: blue }, then when read out of the tree the settings for this will be { color: blue, style: italic // inherited } (simplification * 2)

Outstanding:

  • there is some extra logic to how certain tokens inherit styles and the rules of precedence for tokens which are still unclear -> need to research and implement these here.

so it appears in documentation dropdown
add public keyword to as token color function of trieNode
@codecov
Copy link

codecov bot commented Oct 8, 2018

Codecov Report

Merging #2621 into master will increase coverage by 0.1%.
The diff coverage is 67.23%.

Impacted file tree graph

@@           Coverage Diff            @@
##           master   #2621     +/-   ##
========================================
+ Coverage    45.3%   45.4%   +0.1%     
========================================
  Files         361     362      +1     
  Lines       14571   14678    +107     
  Branches     1912    1930     +18     
========================================
+ Hits         6601    6665     +64     
- Misses       7746    7785     +39     
- Partials      224     228      +4
Impacted Files Coverage Δ
browser/src/Editor/BufferHighlights.ts 16.66% <ø> (ø) ⬆️
...es/SyntaxHighlighting/SyntaxHighlightingReducer.ts 30.95% <0%> (-4.19%) ⬇️
browser/src/Editor/NeovimEditor/NeovimEditor.tsx 8.62% <0%> (ø) ⬆️
browser/src/Utility.ts 46.32% <0%> (-0.7%) ⬇️
...ices/SyntaxHighlighting/SyntaxHighlightingStore.ts 25.86% <0%> (-0.46%) ⬇️
browser/src/neovim/NeovimInstance.ts 5.47% <0%> (ø) ⬆️
...Services/SyntaxHighlighting/TokenThemeProvider.tsx 90.62% <100%> (ø) ⬆️
.../Services/SyntaxHighlighting/SyntaxHighlighting.ts 22.91% <25%> (-1%) ⬇️
browser/src/Services/TokenColorsTrie.ts 69.31% <69.31%> (ø)
browser/src/Services/TokenColors.ts 61.53% <77.77%> (+4.39%) ⬆️
... and 6 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5f8e163...28b3539. Read the comment docs.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant