-
Notifications
You must be signed in to change notification settings - Fork 153
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
Add basic projectionist support #451
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -51,3 +51,19 @@ silent! setlocal formatoptions-=t formatoptions+=croqlj | |
|
||
let b:undo_ftplugin = 'setlocal sw< sts< et< isk< com< cms< path< inex< sua< def<'. | ||
\ '| unlet! b:match_ignorecase b:match_words b:block_begin b:block_end' | ||
|
||
function s:projectionist_detect_elixir() | ||
if filereadable('mix.exs') | ||
let root = simplify(fnamemodify('.', ':p:s?[\/]$??')) | ||
|
||
let projections = {} | ||
let projections['lib/*.ex'] = { 'type': 'main', 'alternate': ['test/{}_test.exs'] } | ||
let projections['lib/**/*.ex'] = { 'type': 'main', 'alternate': ['test/{}_test.exs'] } | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are these additional There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No, these aren't needed, quoting docs:
|
||
let projections['test/*_test.exs'] = { 'type': 'test', 'alternate': ['lib/{}.ex'] } | ||
let projections['test/**/*_test.exs'] = { 'type': 'test', 'alternate': ['lib/{}.ex'] } | ||
|
||
call projectionist#append(root, projections) | ||
endif | ||
endfunc | ||
|
||
autocmd User ProjectionistDetect call s:projectionist_detect_elixir() |
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.
I prefer
type: source
totype: main
, which follows the convention used by the Projectionist documentation. What do you think?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.
I use
type: lib