Skip to content
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

improve snippet manager and add tests #4012

Merged
merged 3 commits into from Jul 15, 2019
Merged

improve snippet manager and add tests #4012

merged 3 commits into from Jul 15, 2019

Conversation

nightwing
Copy link
Member

@nightwing nightwing commented Jul 11, 2019

@codecov
Copy link

codecov bot commented Jul 11, 2019

Codecov Report

Merging #4012 into master will increase coverage by 0.33%.
The diff coverage is 87.53%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #4012      +/-   ##
==========================================
+ Coverage   69.55%   69.89%   +0.33%     
==========================================
  Files         517      517              
  Lines       50224    50382     +158     
  Branches     9474     9492      +18     
==========================================
+ Hits        34933    35214     +281     
+ Misses      15291    15168     -123
Impacted Files Coverage Δ
lib/ace/range_list.js 88.69% <100%> (+0.06%) ⬆️
lib/ace/snippets_test.js 99.36% <100%> (+1.03%) ⬆️
lib/ace/autocomplete.js 63.66% <33.33%> (-0.91%) ⬇️
lib/ace/snippets.js 78.76% <84.11%> (+20.33%) ⬆️
lib/ace/multi_select.js 76.29% <0%> (+0.34%) ⬆️

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 092b70c...33e59b5. Read the comment docs.

Copy link
Contributor

@fjakobs fjakobs left a comment

Choose a reason for hiding this comment

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

Do we have snippets in the Ace code base that would benefit from these changes?

return this.FILEPATH(editor).replace(/[^/\\]*$/, "");
},
FILEPATH: function(editor) { return "/not implemented.txt"; },
WORKSPACE_NAME: function() { return "Unknown"; },
Copy link
Contributor

Choose a reason for hiding this comment

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

How would we be able to configure this value in the IDE?

Copy link
Member Author

Choose a reason for hiding this comment

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

the snippet loader plugin https://github.com/c9/core/blob/d8917f33fd7d32141d895fb7de530cfee2a416cf/plugins/c9.ide.language.generic/snippet_loader.js#L7 will need to do

snippetManager.variables.WORKSPACE_NAME=function() { return c9.projectName }
snippetManager.variables.FILEPATH=function(editor) { return editor.session.c9doc.tab.path }

@nightwing
Copy link
Member Author

Do we have snippets in the Ace code base that would benefit from these changes?

not directly, but this will allow us to replace some of broken snippets that use vim specific backtick syntax with snippets from textmate bundles that will work now.

@nightwing nightwing merged commit d1a9542 into master Jul 15, 2019
@nightwing nightwing deleted the snippets branch July 15, 2019 08:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Deletion of nested selections in snippets cause highlighting error
2 participants