Comments (10)
Hi, sorry for the late reply. Are you able to provide some sort of pseudocode JSON output of what you're expecting? Do you want me to expose something like { row: 2, col: 4 }
when you press Ctrl + C
?
Looking at your SO question, it looks like you want to copy both the index of the starting position and the selected text in one "Copy" command, is that right? If so, this sounds like a very niche use case, and I can't say I'd spend much time working on it. The purpose of this tool is to help developers write AHK code, and I don't see how that would help. You're more than welcome to help me understand how this is useful!
from ahkpp.
Hi, my use case was to produce an AHK script that could simplify the creation of folding block comments.
As it is, VSC requires lines of text within the block comment to be indented for it to fold. The need for indentation can be eliminated with the combined use of the folding region tags ;region ;endregion
; the tag combination can be achieved by removing the circumflex anchors from lines 34 & 35 of the ahk.configuration.json
file.
For the script to function correctly, it would need to ensure the selected block of text starts at column 0 and finishes at the end of a line and would otherwise issue an alert when launched.
Perhaps this concept could be encoded within the extension, possibly being called from the editor's context menu?
from ahkpp.
I saw your commit to cweijan
's repo, and I appreciate the contribution! I plan to review the changes he's made and merge them into mine, including the removal of the anchors that you mentioned. Folding block comments are definitely important to me, and I think I can do even better than the implementation you've shown in your screenshot. Instead of:
/* ;region
line one
line two
*/ ;endregion
How about:
/*
line one
line two
*/
And the above comment is foldable?
from ahkpp.
what extension are you using to make block comments foldable ?
currently I'm using this (toggle line comments):
https://stackoverflow.com/questions/60334430/shortcut-to-toggle-commented-and-uncommented-code-at-the-same-time#60366506
from ahkpp.
I saw your commit to cweijan's repo, and I appreciate the contribution!
I made a further commit here. I edited the RegEx's like so...
"start": "^(\\/\\*)?\\s*\\;\\s*region\\b",
"end": "^(\\*\\/)?\\s*\\;\\s*endregion\\b"
How about:
/*
line one
line two
*/And the above comment is foldable?
Yes, just like in Notepad++ and similar editors.
This is a folding 'helper' script I devised.
from ahkpp.
@fade2gray I answered your question, but on stack overflow
https://stackoverflow.com/questions/64791832/found-somevscode-how-can-i-determine-the-cursors-column-position-within-an-edi#65316198
from ahkpp.
@FuPeiJiang Yes, thanks for that. I didn't reply there because it says not to leave comments just to say "thanks". Now, with my extremely limited experience with creating extensions, I need to try and implement your code suggestion.
Thanks again. 👍
from ahkpp.
I think you already solved it using ahk ? did you ?
https://code.visualstudio.com/api/get-started/your-first-extension
yo code
I choose javascript extension because it is faster than typescript to test
on the left, in debug, click the green button
and then
ctrl+shift+p to run a command, the command name defaults to "Hello World"
idk yet how to edit file using vscode, how to copy to clipboard
from ahkpp.
using ahk, if you want to block comment lines without selecting the full line, (without selecting start of line, without selecting end of line)
f1::
sleep, 50
mass:=getClip()
send, +{home}
left:=getClip()
send, +{end}
right:=getClip()
finalstr:=";region `r`n" left mass right "`r`n;endregion"
clipboard:=finalstr
send, ^v
arr:=StrSplit(finalstr,"`n", "`r")
loop % arr.Length() - 1 {
send, {up}
}
send, {home}
loop 8
send,{right}
return
; Reload
getClip()
{
clipboard:=""
Send, {ctrl down}x{ctrl up}
sleep, 50
return clipboard
}
from ahkpp.
Closed by #27
from ahkpp.
Related Issues (20)
- How to get intelisense suggestions for functions stored in '.\Documents\lib' ? HOT 2
- AHK V1 files language mode is always set to `AutoHotkeyV2` HOT 9
- Parser stops working on AHK v1.1 files HOT 4
- Extension forgot AHK location HOT 4
- "Go to definition" using Ctrl + Click jumps to another file opened in editor / or doesn't jump to definition at all within the same file if the file is very long ~10k lines HOT 1
- Wrong indentation when moving line of code out of if-statement HOT 1
- Wrong indentation: press Enter after condition-block in If-statement
- AHK++ is not activating. HOT 11
- "Run" command thinks a V1 script is V2. HOT 4
- Formatter replaces multiple spaces with a single space inside a string HOT 1
- Wrong indentation on copy-paste HOT 6
- How to format code There is no formatter for 'ahk2' files installed. HOT 2
- No format intelicence or formating or colors HOT 4
- Language Switch problems HOT 2
- format code feature changes the number of spaces in a constant string HOT 1
- Debugger takes keyboard focus from active window HOT 1
- The Open AutoHotkey Help command is failing HOT 2
- allow rename variables HOT 1
- Availability as standalone LSP HOT 2
- Shortcut to comment/decomment selected line HOT 3
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 ahkpp.