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

Create interface files #66

Open
dkirchhof opened this issue Feb 18, 2023 · 0 comments
Open

Create interface files #66

dkirchhof opened this issue Feb 18, 2023 · 0 comments

Comments

@dkirchhof
Copy link

As this plugin is for neovim AND vim, I don't know, how to manage it.
So maybe just for everyones interest, I created a function (for neovim) to automatically create resi files:

function createInterfaceFile()
    local path = vim.api.nvim_buf_get_name(0)

    if vim.fn.filereadable(path .. "i") == 1 then
        print("Interface file already exists")
    else
        -- print("Create interface file")

        vim.lsp.buf_request(
          0, 
          "textDocument/createInterface", 
          { uri = "file://" .. path }, 
          function ()
            print("Interface file created")
          end
        )
    end
end

vim.cmd("command RescriptCreateInterfaceFile lua createInterfaceFile()")
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

No branches or pull requests

1 participant