Cannot declare functions when there is "import" statement
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 537
- Forks
- 57
- Avg merge
- 1h 6m
- Merged PRs (30d)
- 6
Description
This is my rplugin (actually I just copied from the prototype example)
function MyPlugin(plugin) {
this.plugin = plugin;
plugin.registerFunction('MyFunc', [this, MyPlugin.prototype.func]);
}
MyPlugin.prototype.func = function() {
this.plugin.nvim.setLine('A line, for your troubles');
};
export default MyPlugin;
If I save it to ~/.config/nvim/rplugin/node/myplugin/index.js then run :UpdateRemotePlugins | !cat ~/.local/share/nvim/rplugin.vim, then the result show that the function MyFunc has been registered. But if I just add this line to the top of the file index.js
import { abort } from "process";
Running :UpdateRemotePlugins | !cat ~/.local/share/nvim/rplugin.vim again and it show that the function MyFunc is not registered
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the rplugin file at ~/.config/nvim/rplugin/node/myplugin/index.js and compare the output of :UpdateRemotePlugins | !cat ~/.local/share/nvim/rplugin.vim with and without the import statement. Done means MyFunc remains registered after the import is present.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, nodejs
- Domain
- devtools
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100