emartineau / selectionwrapper Goto Github PK
View Code? Open in Web Editor NEWWraps text depending on the key pressed, like in Visual Studio Code
License: MIT License
Wraps text depending on the key pressed, like in Visual Studio Code
License: MIT License
Please, update it for Visual Studio 2022, I severely miss this extension in the newest version
I'd be eternally grateful
test(
[into clipboard]abc
Expected: abc
is replaced with test(
Actual: abc is wrapped with
test(and
)resulting in
test(abc)instead of
test(`
Especially problematic example/consequence:
For content abc()
with clipboard content test(
:
abc(
Expectation: test()
Actual: test(abc())
(
to write a (
Expected: It writes a (
or a ()
on every cursor
Actual: It writes
(
)
(on every cursor position)
so if you select some code and wrap it in ( )s, it wont deselect the code, allowing you to move the caret to the start of the brackets (like what you can do in intellij for example).
great plugin btw :)
I really like this extension and think its functionality should be the default behavior in Visual Studio.
One thing I'm missing however is this:
If the cursor is placed between two matching characters and I press Backspace I'd like to delete the one on the right as well automatically instead of having to manually press Delete afterwards.
So e.g. "foo.Bar(|);" becomes "foo.Bar|;" (where | is the cursor) when pressing Backspace.
Would it be possible to add this?
Apparently the extension doesn't work when using multiple selection. Instead of wrapping in parenthesis, it just prints the opening character, removing all the selected text in the process. This could be a bug, also.
I am not sure what I did specifically but a NullReferenceException
occurred.
3080 | ERROR | System.NullReferenceException: Object reference not set to an instance of an object.
at SelectionWrapper.Wrapper.Wrap(ITextBuffer textBuffer)
at SelectionWrapper.EditorListener.TextBuffer_PostChanged(Object sender, EventArgs e)
at Microsoft.VisualStudio.Text.Utilities.GuardedOperations.RaiseEvent(Object sender, EventHandler eventHandlers)
--- End of stack trace from previous location where exception was thrown ---
at Microsoft.VisualStudio.Telemetry.WindowsErrorReporting.WatsonReport.GetClrWatsonExceptionInfo(Exception exceptionObject)
3081 | ERROR | System.NullReferenceException: Object reference not set to an instance of an object.
at SelectionWrapper.Wrapper.Wrap(ITextBuffer textBuffer)
at SelectionWrapper.EditorListener.TextBuffer_PostChanged(Object sender, EventArgs e)
at Microsoft.VisualStudio.Text.Utilities.GuardedOperations.RaiseEvent(Object sender, EventHandler eventHandlers)
--- End of stack trace from previous location where exception was thrown ---
at Microsoft.VisualStudio.Telemetry.WindowsErrorReporting.WatsonReport.GetClrWatsonExceptionInfo(Exception exceptionObject)
Please add in your extention the ability to automatically close brackets even when no text is selected.
Automatic brace completion
does not works properly in Visual Studio IDE:
but VSCode does this job correctly:
I would disable Visual Studio standard behavior:
and enable your extension's option. I suggest to add into settings one more option:
SelectionWrapper.AutomaticalyCloseAnyBraces: true/false
enabling this option should cause automatically close open braces: (), {}, []
mouse cursor should be between braces: (|), {|}, [|]
to avoid incorrect behavior angle brackets should not auto close:
if(a<>b)
Multiple times now I have opened/switched files and VS reports exceptions. Checking the activity log its NullReferenceExceptions from this plugin.
System.NullReferenceException: Object reference not set to an instance of an object.
at SelectionWrapper.Wrapper.Wrap(ITextBuffer textBuffer)
at SelectionWrapper.EditorListener.TextBuffer_PostChanged(Object sender, EventArgs e)
at Microsoft.VisualStudio.Text.Utilities.GuardedOperations.RaiseEvent(Object sender, EventHandler eventHandlers)
--- End of stack trace from previous location where exception was thrown ---
at Microsoft.VisualStudio.Telemetry.WindowsErrorReporting.WatsonReport.GetClrWatsonExceptionInfo(Exception exceptionObject)
--
Just now I opened a file with CTRL+T, typing part of the file name, and hitting enter.
I can not directly reproduce it though. So probably depends on some state.
Please tag the releases in this Git repository so changes can be checked and whether changes have been made since the currently released version.
Thank you
For content
abstract
abstract
a
, and enter multi-cursor editing (SHIFT+ALT+Down) to place a second cursor on the second line after the a.b
characters.(
Expected: both b
characters are wrapped in parentheses (just like when this is done with a single cursor on a single line)
Actual:
a(b
b
)stract
a(b
b
)stract
When multi-cursor mode is entered from bottom to top instead the b
is being replaced:
a(stract
a(stract
Pretty self-explanatory. The only version supported currently is vs2019.
It should only be a matter of changing manifesto, and there are already 3 forks doing that.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.