-
Notifications
You must be signed in to change notification settings - Fork 80
[WIP] Complete CSS selectors inside of attributes #21
base: master
Are you sure you want to change the base?
Conversation
|
||
getStylesheetsAtPath: (dir) -> | ||
stylesheets = [] | ||
for file in fs.readdirSync(dir) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Scanning a whole project on each autocomplete call is too expensive IMO
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is more like proof of concept. Look on my to-do list about caching.
On Wed, Dec 30, 2015, 23:50 Steel Brain [email protected] wrote:
In lib/provider.coffee
#21 (comment):@@ -168,7 +170,42 @@ module.exports =
attributePattern.exec(line)?[1]
- getAttributeValues: (attribute) ->
- getLocalStylesheets: (editor) ->
- source = editor.getText()
- while match = stylePattern.exec(source)
match[1]
- getStylesheetsAtPath: (dir) ->
- stylesheets = []
- for file in fs.readdirSync(dir)
Scanning a whole project on each autocomplete call is too expensive IMO
—
Reply to this email directly or view it on GitHub
https://github.com/atom/autocomplete-html/pull/21/files#r48611158.
@mnquintana @50Wliu could you guys take a look on updated implementation? I've basically copy pasted load-paths-handler.coffee from fuzzy-finder package since looks like there are no other way to browse all project files. It does lookup all files on package activation and updates completions index on each save event. Any advices? |
Hi, |
@sadovnychyi is it working when |
@florianbouvot it does. https://github.com/atom/autocomplete-html/pull/21/files#diff-43f9c4cec188d77db17033d59fb3944dR202 It scans all of ['.css', '.scss', '.less', '.html'] in your project. I been using this branch for a long time, there's just issues that I don't have time to resolve and it's unsafe to merge without fixing them. But basically this is very usable as is. |
@sadovnychyi cool and how can we use it now ? |
Just clone, switch the branch and |
@sadovnychyi thank you, I think you should consider to create a dedicated plugin 😉 |
atom/atom#14853 -- I think after this is merged it would be much easier to solve some issues here. |
@sadovnychyi I clone
I understand 😉 |
need this BADLY :( |
Is this pull request still alive? What can one do to help? I'm guessing this pull request needs to be decaffeinated before it can be merged? |
@vinkla I think there's language servers available for this now, would make sense to use one of those. |
This is work in progress and still requires some modifications, but I would love to hear some feedback before I will continue.
Lookup all
.css
,.scss
and.less
files in project on package activation. Look forentity.other.attribute-name.class.css
orentity.other.attribute-name.id.css
scopes inside of each file. This makes it work with any stylesheets supported by Atom. No need to use external CSS parser.bower_components
directory#13