GithubHelp home page GithubHelp logo

how to config the swiftformat for efmls? I can't understand different formatter configuration in source code. about efmls-configs-nvim HOT 5 CLOSED

creativenull avatar creativenull commented on June 10, 2024
how to config the swiftformat for efmls? I can't understand different formatter configuration in source code.

from efmls-configs-nvim.

Comments (5)

0xnofoot avatar 0xnofoot commented on June 10, 2024 1

you are my god, thank you very much again.
It turns out that for some linters, you don't need to add the last parameter, such as-or ${INPUT}. I haven't succeeded before because I haven't figured this out.

from efmls-configs-nvim.

0xnofoot avatar 0xnofoot commented on June 10, 2024

I do it, use this command: "swiftformat stdin --stdinpath '${INPUT}'"
local ls = {
sh = {
require('efmls-configs.formatters.beautysh'),
},
zsh = {
require('efmls-configs.formatters.beautysh'),
},

swift = {
	{
		formatCommand = "swiftformat stdin --stdinpath '${INPUT}'",
		formatStdin = true,
	}
}

}

L = {
setup = function(lspconfig)
lspconfig.efm.setup({
filetypes = vim.tbl_keys(ls),

		init_options = {
			documentFormatting = true,
			documentRangeFormatting = true,
		},

		settings = {
			languages = ls,
		},
	})
end,

}

return L

from efmls-configs-nvim.

creativenull avatar creativenull commented on June 10, 2024

I think you are missing --quiet but I've went ahead and added the swiftformat as a config for you to try.

Try to update the plugin and replace your swift with the following:

local ls = {
  -- ...
  swift = {
    require('efmls-configs.formatters.swiftformat')
  }
}

Let me know if you're still having issues with the config or not.

from efmls-configs-nvim.

0xnofoot avatar 0xnofoot commented on June 10, 2024

thank you very much, there will be error in LspLog without --quiet, thank you for your comment and update.

I have other problem for realm/SwiftLint, I tried my best but couldn't configure it, so I ended up using nvim-lint.
Could you give me some advice if you have time? Finally, thank you again for your update, which is very helpful to me.

from efmls-configs-nvim.

creativenull avatar creativenull commented on June 10, 2024

Added swiftlint, give it try whenever you can or anyone else.

Also feel free to look at the code and use it however you want. I've tested it on my machine and seems like the lintFormats work.

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.