Thread overview | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
June 01, 2020 I want Sublime 3 D auto import ! | ||||
---|---|---|---|---|
| ||||
I want Sublime D auto import ! When typing code like this: class Uno : IStylable { // } I want will be auto added "import IStylable" at begin of file. Like this: import ui.istylable : IStylable; class Uno : IStylable { // } 1. I want for plugin will scan all files in project, and grep for "module <name>". 2. Then "module <name>" replaced to "import <name>". 3. Then "import <name>" inserted in text. At top. After line "module ..." if it exist, else just at top. 4. Check for "module <name>" not exists before insert. |
June 01, 2020 Re: I want Sublime 3 D auto import ! | ||||
---|---|---|---|---|
| ||||
Posted in reply to Виталий Фадеев | On Monday, 1 June 2020 at 16:18:44 UTC, Виталий Фадеев wrote:
> I want Sublime D auto import !
>
> When typing code like this:
>
>
> class Uno : IStylable
> {
> //
> }
>
>
> I want will be auto added "import IStylable" at begin of file. Like this:
>
>
> import ui.istylable : IStylable;
>
> class Uno : IStylable
> {
> //
> }
>
>
> 1. I want for plugin will scan all files in project, and grep for "module <name>".
> 2. Then "module <name>" replaced to "import <name>".
> 3. Then "import <name>" inserted in text. At top. After line "module ..." if it exist, else just at top.
> 4. Check for "module <name>" not exists before insert.
Demanding stuff usually doesn't work in this community. The usual answer is something like this: If you care about this, implement it yourself or pay somebody to do it.
|
June 01, 2020 Re: I want Sublime 3 D auto import ! | ||||
---|---|---|---|---|
| ||||
Posted in reply to Виталий Фадеев | On Monday, 1 June 2020 at 16:18:44 UTC, Виталий Фадеев wrote: > I want Sublime D auto import ! > > When typing code like this: > > > class Uno : IStylable > { > // > } > > > I want will be auto added "import IStylable" at begin of file. Like this: > > > import ui.istylable : IStylable; > > class Uno : IStylable > { > // > } > > > 1. I want for plugin will scan all files in project, and grep for "module <name>". > 2. Then "module <name>" replaced to "import <name>". > 3. Then "import <name>" inserted in text. At top. After line "module ..." if it exist, else just at top. > 4. Check for "module <name>" not exists before insert. Your best bet for getting IDE-like features like this is probably to use serve-d [1] together with a language server client plugin for your editor [2]. [1] https://github.com/Pure-D/serve-d [2] https://github.com/sublimelsp/LSP |
June 02, 2020 Re: I want Sublime 3 D auto import ! | ||||
---|---|---|---|---|
| ||||
Posted in reply to Paul Backus | On Monday, 1 June 2020 at 18:55:03 UTC, Paul Backus wrote: > On Monday, 1 June 2020 at 16:18:44 UTC, Виталий Фадеев wrote: I do it! https://github.com/vitalfadeev/SublimeDlangAutoImport |
June 02, 2020 Re: I want Sublime 3 D auto import ! | ||||
---|---|---|---|---|
| ||||
Posted in reply to Виталий Фадеев | On Tuesday, 2 June 2020 at 06:00:10 UTC, Виталий Фадеев wrote:
> On Monday, 1 June 2020 at 18:55:03 UTC, Paul Backus wrote:
>> On Monday, 1 June 2020 at 16:18:44 UTC, Виталий Фадеев wrote:
>
> I do it!
>
> https://github.com/vitalfadeev/SublimeDlangAutoImport
Great! You should make a post about it in the Announce forum, so that other Sublime Text users will see it.
|
June 02, 2020 Re: I want Sublime 3 D auto import ! | ||||
---|---|---|---|---|
| ||||
Posted in reply to Виталий Фадеев | On Tuesday, 2 June 2020 at 06:00:10 UTC, Виталий Фадеев wrote:
> On Monday, 1 June 2020 at 18:55:03 UTC, Paul Backus wrote:
>> On Monday, 1 June 2020 at 16:18:44 UTC, Виталий Фадеев wrote:
>
> I do it!
>
> https://github.com/vitalfadeev/SublimeDlangAutoImport
Cool. I dont use classe but I see how this kind of functionality might be useful for other symbols.
|
June 02, 2020 Re: I want Sublime 3 D auto import ! | ||||
---|---|---|---|---|
| ||||
Posted in reply to Виталий Фадеев | On Tuesday, 2 June 2020 at 06:00:10 UTC, Виталий Фадеев wrote:
> On Monday, 1 June 2020 at 18:55:03 UTC, Paul Backus wrote:
>> On Monday, 1 June 2020 at 16:18:44 UTC, Виталий Фадеев wrote:
>
> I do it!
>
> https://github.com/vitalfadeev/SublimeDlangAutoImport
What happens if you have the same symbol in multiple modules? Ex. two libraries that implement symbols with same name.
Is there a way to be selective? And what about keyboard shortcut?
|
June 03, 2020 Re: I want Sublime 3 D auto import ! | ||||
---|---|---|---|---|
| ||||
Posted in reply to Johannes Loher | On Monday, 1 June 2020 at 17:28:16 UTC, Johannes Loher wrote:
> On Monday, 1 June 2020 at 16:18:44 UTC, Виталий Фадеев wrote:
>> [...]
>
> Demanding stuff usually doesn't work in this community. The usual answer is something like this: If you care about this, implement it yourself or pay somebody to do it.
Depends on how you interpret it.
|
June 03, 2020 Re: I want Sublime 3 D auto import ! | ||||
---|---|---|---|---|
| ||||
Posted in reply to bauss | On Tuesday, 2 June 2020 at 20:08:09 UTC, bauss wrote: > What happens if you have the same symbol in multiple modules? Ex. two libraries that implement symbols with same name. > First module will inserted. > Is there a way to be selective? I want it too! :) > And what about keyboard shortcut? A specially for you ! Sublime 3 / Preferences / Key bindings: [ { "keys": ["alt+a"], "command": "dlang_auto_import" }, ] |
June 04, 2020 Re: I want Sublime 3 D auto import ! | ||||
---|---|---|---|---|
| ||||
Posted in reply to Виталий Фадеев | On Wednesday, 3 June 2020 at 11:54:57 UTC, Виталий Фадеев wrote:
> On Tuesday, 2 June 2020 at 20:08:09 UTC, bauss wrote:
>> What happens if you have the same symbol in multiple modules? Ex. two libraries that implement symbols with same name.
>>
>
> First module will inserted.
>
>> Is there a way to be selective?
>
> I want it too! :)
>
>> And what about keyboard shortcut?
>
> A specially for you !
>
> Sublime 3 / Preferences / Key bindings:
> [
> { "keys": ["alt+a"], "command": "dlang_auto_import" },
> ]
Thanks, that's great!
|
Copyright © 1999-2021 by the D Language Foundation