Last active
December 9, 2020 15:12
-
-
Save hrsh7th/46ffe9f4e04cfd29d1e5d281a957fa32 to your computer and use it in GitHub Desktop.
sample
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local lapi = require'lapi' | |
local SELECTOR = { | |
markers = { 'package.json' }, | |
filetypes = { 'javascript', 'typescript', 'javascript.jsx', 'typescript.tsx' }, | |
} | |
lapi.extensions.register('eslint', { | |
is = function(document) | |
return document.is(SELECTOR) | |
end, | |
activate = function(extension) | |
assert(vim.loop.exepath('eslint'), 'should install eslint for your path.') | |
extension.attach(lapi.completion.register('eslint', { | |
is = function(document) | |
return document.is(SELECTOR) | |
end, | |
metadata = function() | |
end, | |
datermine = function() | |
end, | |
complete = function() | |
end, | |
resolve = function() | |
end, | |
})) | |
extension.attach(lapi.workspace.on_text_document_did_open(function(event) | |
local document = event.document | |
if not document.is(SELECTOR) then | |
return | |
end | |
end)) | |
return extension | |
end, | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment