Polymer element tag and attribute autocompletions in Atom.
Preview video of autocomplete-polymer in action
From the Atom editor menus, navigate to Atom -> Preferences
.
Click on the install tab and enter autocomplete-polymer
in the search field.
For the package to offer autocompletion hints it needs to have a list of the possible elements
in your current project. This is saved within a file in your projects root directory named .ac-poly.json
. This file needs to built for each polymer project and updated when elements are changed or added (including bower components). It is recommended that the file is added to your .gitignore
.
Whenever you need to build / update the autocompletion dictionary (.ac-poly.json
) then run the Update Project Completions Dictionary
command in the autocomplete-polymer package menu (Packages -> Autocomplete Polymer
) in the top toolbar.
You can also call Autocomplete Polymer:Update
from the command palette (cmd + shift + p
) or use the keyboard shortcut ctrl + alt + p
.
The package builds a list of autocompletions by:
js
and html
files that are not within a folder named test
or demo
.Polymer({ is: '...'})
).esprima
such that we can pull out the elements names and a list of it's properties.test
or demo
folder.js
and html
files.This project is a fork of the autocomplete-html project. The project makes use of scandal for directory scanning and file searching, esprima for the javascript analysis and estraverse for the transversal of the abstract syntax tree.
Please add an issue in the GitHub repository if you find any bugs, have improvement ideas, or requests.
Any pull requests will be greatly welcome since I'm sure there is plenty of room for improvement.
Mark Silverwood
Good catch. Let us know what about this package looks wrong to you, and we'll investigate right away.