GithubHelp home page GithubHelp logo

Comments (7)

creativenull avatar creativenull commented on June 2, 2024 1

Glad you enjoy it πŸ™‚

Don't forget there is none-ls which is a fork in case it doesn't work out. I should put this in the readme πŸ€”

from efmls-configs-nvim.

creativenull avatar creativenull commented on June 2, 2024 1

I see where the problem is now, seems like your efm config is on your user config. Hence, the efmls-configs configurations is being executed (for path checking) as soon as you open nvim.

I've browsed the project.nvim plugin and don't see that they have any hooks for you to run some custom logic after you've switched to a project dir (where you could run the efm lspconfig setup).

I think you should use DirChanged autocmd to then run efm setup config in it, instead of setting up efm in your main config. That way, efmls-configs will check for the paths when it's executed inside DirChanged event.

What I mean is, listen to a DirChanged event and then run require('lspconfig').efm.setup() inside that event. Of course, you will need some extra logic to know which project should run efm.

This is similar to what I do with my project plugin (creativenull/projectlocal.vim) where I setup a file on my project directory which will be executed when I cd into the directory (whether from terminal or from inside nvim). But fundamentally different to how project.nvim does it πŸ˜…

from efmls-configs-nvim.

creativenull avatar creativenull commented on June 2, 2024

Hmm this is weird, it should work out of box with mason.nvim.

Are you in the project directory when you open nvim? You have to be in the project directory for it to pick up eslint install to node_modules.

Could you also check some things:

  • Run :!which eslint command inside nvim, it should either print out the path of eslint binary if installed via mason
  • Make sure you're not running the eslint lsp server, this is different to eslint run by efm, :LspInfo should only show efm and maybe tsserver but not eslint
  • Scoped it down to just eslint in your languages
local eslint = require('efmls-configs.linters.eslint')
local languages = {
  javascript = { eslint },
  typescript = { eslint },
}

And then run :lua =vim.lsp.get_active_clients({ name = 'efm' }) and verify the settings property has the setup you have.

from efmls-configs-nvim.

AntDavidLima avatar AntDavidLima commented on June 2, 2024

I thought ahmedkhalf/project.nvim was cding into my project directory for me, because when I run :!pwd it prints the correct work directory, but to be sure I opened nvim from the directory, and it just worked.

Thanks for your help and congratulations on the project, it was really great to find this when I heard about the null-ls archiving.

from efmls-configs-nvim.

AntDavidLima avatar AntDavidLima commented on June 2, 2024

Sorry for reopening the issue, but since I don't think I'm getting any help soon on ahmedkhalf/project.nvimissues, I will ask for some help here.
ahmedkhalf/project.nvim changes my cwd, since the result of :!pwd is the same as the project I'm working in, what should be changed to efmls use my project installed ESLint and Prettier?

from efmls-configs-nvim.

creativenull avatar creativenull commented on June 2, 2024

Hmm I would check if :pwd is in the project and not :!pwd which is the current working directory of the terminal/shell.

But outside of that I can only recommend to cd into the project for it to pick up your eslint and prettier setup.

from efmls-configs-nvim.

AntDavidLima avatar AntDavidLima commented on June 2, 2024

Yeah, the result of :!pwd and :pwd is the same.

I would like it to work when I open the project with ahmedkhalf/project.nvim, I don't like to first try to remember the path of the project, then cd into it and only then open Neovim every time I want to change projects, but thanks for the help anyway.

from efmls-configs-nvim.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.