Comments (25)
vim/neovim...?
from sourcery.
Atom Editor please!
from sourcery.
Emacs please!
from sourcery.
How about Sublime Text? :)
from sourcery.
Atom Editor, please.
from sourcery.
Spyder please!
from sourcery.
vim/neovim...?
I'm using it via coc.nvim
, it is quite easy to setup:
- Download and extract a release of Sourcery or use
pip install --user sourcery-cli
- Add this to your
coc-settings.json
:
{
"languageserver": {
"sourcery": {
"command": "<Sourcery Directory>/sourcery",
"args": [
"lsp"
],
"filetypes": [
"python"
],
"initializationOptions": {
"token": " <Your Token Here>",
"extension_version": "coc.nvim",
"editor_version": "vim"
},
"settings": {},
"trace.server": "verbose"
}
}
}
- Profit!
PS: This can be Sourcery can be used in any LSP capable editor
from sourcery.
After an internal discussion we've realised that the API should be stable enough to support community plugins. The Sourcery binary uses LSP so that's not going to change and the core functionality of Sourcery is not going to change much either
@zingbretsen - we would be delighted if you wrote a plugin for emacs. At the moment we have no documentation on how to do this and are not quite clear what documentation would be needed. I'll drop you an email and we can see if we can get something rolling
from sourcery.
If anyone is interested you can use Sourcery with native Neovim LSP. I have the following setup in a file called sourcery.lua
:
local configs = require 'lspconfig/configs'
local util = require 'lspconfig/util'
local server_name = 'sourcery'
configs[server_name] = {
default_config = {
cmd = {server_name, 'lsp'},
filetypes = {'python'},
init_options = {
editor_version = 'vim',
extension_version = 'vim.lsp',
token = '<YOUR_TOKEN>'
},
root_dir = function(fname)
local root_files = {
'pyproject.toml',
'setup.py',
'setup.cfg',
'requirements.txt',
'Pipfile'
}
return util.root_pattern(unpack(root_files))(fname) or
util.find_git_ancestor(fname) or util.path.dirname(fname)
end
},
docs = {
description = [[
https://github.com/sourcery-ai/sourcery
Refactor Python instantly using the power of AI.
]]
}
}
Mainly based off the pyright config from here.
In your main config just add
require('sourcery')
require('lspconfig').sourcery.setup {}
from sourcery.
I use Eclipse + Pydev and believe it's still quite popular. At least it figures in lots Top best Python IDE's ;-)
from sourcery.
Atom Editor, please!
from sourcery.
@fvdnabee I believe it's probably mostly personal preference, although native LSP may be slightly faster. I have switched over to fully use native LSP so wanted to integrate sourcery that way and luckily it's easy to use currently unsupported language servers.
from sourcery.
Are you open to people making community plugins? Are there any references for how we might do such a thing with Sourcery?
It is something we've thought about - We've done the VS Code plugin as a language server so it should certainly be possible. I think we want to nail down the functionality first - we're still in beta so might still be making large changes to how things work.
from sourcery.
Thanks for raising @bachya. #89 has been raised with a solution for this
from sourcery.
Vim would definitely be a welcomed addition.
from sourcery.
Are you open to people making community plugins? Are there any references for how we might do such a thing with Sourcery?
from sourcery.
I'm using Geany and I feel like a plugin would be a nice addition. If you want to, of course 😄
from sourcery.
Thanks for the instructions on setting it up in Vim @marcoaaguiar.
I've written it up into full install and usage instructions in our wiki.
from sourcery.
I'm using @marcoaaguiar's suggestion and when I attempt to run :CocDiagnostics
in a Python file, I see this message:
[coc.nvim] Sourcery sign-up required. Click [here](https://sourcery.ai/download/) for a free token then enter it into the Sourcery section of the [settings](command:workbench.action.openSettings "Open Settings").
I've confirmed that my token is added in languageserver.sourcery.initializationOptions.token
in my coc-settings.json
.
Versions:
- Neovim 0.4.4
- Node.js 10.20.1
- coc.nvim 0.0.79-8da7b2139d
from sourcery.
from sourcery.
How about Sublime Text? :)
Sourcery is now available for Sublime!
https://sourcery.ai/blog/sourcery-sublime/
from sourcery.
https://nova.app it's the editor by Panic. Same developers who built coda and transmit. Thanks in advance
from sourcery.
@cjber would you mind elaborating one would choose the native Neovim LSP integration over the coc config approach from the wiki? Improved integration, improved performance, any other reasons?
from sourcery.
Just going to leave this here: if anyone struggles to get Sourcery working on Arch as I was, just getting cryptic error messages from neovim exit code 127
, it's because Arch is missing libcrypt.so.1. You can get round this by installing ibxcrypt-compat
from sourcery.
I couldn't get the Sublime Text to work, perhaps because the instructions are out of date.
from sourcery.
Related Issues (20)
- Sourcery plugin in VSCode uses too much process HOT 5
- Sourcery doesn't recognise Jetbrains 'remote development' WSL project as open source HOT 1
- Project disabled for account due to open source account. I have a pro account HOT 1
- FIX Cannot select and copy that text in Sourcery sidebar HOT 3
- mapping values are not allowed here HOT 2
- The "CI" link is incorrect HOT 1
- Remaining manual issues should be listed separately from autofixed ones HOT 1
- Sourcery seems to hate anything Linux related? HOT 1
- Incorrect structure when generating docstrings HOT 2
- After upgrading to Pro Plan the VsCode Extension still identifies me as being on the Open-source Plan HOT 2
- VS Code: Couldn't create connection to server to Sourcery at startup HOT 2
- docstrings style
- MacOs PyCharm Plugin stuck at "Loading" HOT 2
- Implement "Generate Docstring" & "Generate Test Cases" in CLI and Neovim
- review doesn't work on organization's repo HOT 4
- PyCharm plugin freezes - restart possible? HOT 2
- It should review changed files, not original. HOT 1
- Sourcery GitHub app returns no status if no refactorings have been found HOT 1
- Sourcery plugin not working for Pycharm HOT 4
- feat: review should be updated or create a new one. HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sourcery.