Comments (8)
As I recall there are several edge cases this doesn't handle, so we were going to need to surface an opt-in to warn users about the potential perils of using this feature. @andyleejordan can elaborate, but I recommend continued discussion happen on the PR or issue and not on this dupe.
from vscode-powershell.
Dupe of #261
In short, this is very difficult because PowerShell is not a statically typed or scoped language. We hope to explore a limited scope of rename but it would need to be known it will be opt-in with shortcomings with a warning. See more detail on that issue.
from vscode-powershell.
Practically, you don't have to do anything, everything is done inside LSP, it looks like all you need to do is consume and implement these APIs and interfaces to provide rename functionality for this extension. What means you don't have to code the renaming feature from the ground up.
from vscode-powershell.
"Practically, you don't have to do anything, everything is done inside LSP"
And who do you think writes the LSP? 😁
https://github.com/PowerShell/PowerShellEditorServices
There is no rename functionality implemented in the LSP (PSES) as of yet. That's the primary first task that must occur before it can be wired up in the frontend extension. Issues for PSES are usually first tracked here as it's where most people first look, but the two are developed mostly in tandem (VSCode being the "primary" consumer of PSES, but there's other editors too (neovim, atom, etc.)
from vscode-powershell.
I saw #261, at least renaming a local variable inside functions or inside the closest scope shouldn't be a problem, vscode API provides registerRenameProvider
a little described here (this page also contains other info about renaming, search: "rename") and in deep described here and here.
Have you tried these APIs? They are supposed exactly for this purpose. You can use these APIs since this extension uses LSP.
from vscode-powershell.
What means you don't have to code the renaming feature from the ground up.
It looks like that is the exact opposite of what I wrote. 😎🙃 You will have to code everything yourself. I have found PowerShell/PowerShellEditorServices#2152 and also #4950, it looks like one year of hard work, what is the state of this PR, will be merged soon or it's still in the early stages?
from vscode-powershell.
Code quality looks good with a lot of tests.
from vscode-powershell.
Ok, I'm going to sleep because I'm in half suspend mode already, writing with one eye already closed, thx for replies, I will dream about renaming in pwsh 😅
from vscode-powershell.
Related Issues (20)
- VS Code with PowerShell extension fails to assig a value to a variable HOT 2
- Debug string [DBG] not displayed in the terminal HOT 19
- Powershell Extension never starts. Terminal Message: "Starting server, deregistering host logger and registering shutdown listener" HOT 11
- Launching VSCode Also Opens cmd.exe Console Behind VSCode HOT 3
- Intellisense not working for properties of the same type as the class HOT 2
- v2024.2.0 No longer loads my Pwsh profile in the integrated terminal. How can I fix this? HOT 7
- v2024.2.0: PowerShell Terminal Fails to Load Due to PSES change to non-Windows-trusted Certificate HOT 36
- If Connecting to MSGraph then connecting to ExchangeOnline, error OperationStopped: Could not load file or assembly 'Microsoft.Identity.Client, Version=4.44.0.0. HOT 5
- vscode theme/colors breaks when i open each new tab/extention page HOT 3
- VSCode "restart extensions" on any extension update makes vscode-powershell start a new terminal HOT 5
- Function Parameters in a Class Module Do Not Show in Intellisense/Autocompletion HOT 6
- Language Server Becomes Unresponsive After Opening Command Explorer HOT 1
- Set `Code Formatting:` settings based on existing PSScriptAnalyzerSettings.psd1 so autoformat stays in sync with ScriptAnalyzer HOT 2
- When a line ends in an equal sign, automatically indent the next line since it is part of the assignment statement HOT 1
- Feature Request: Support the "env" key in launch.json for debugging Environment Variable setup HOT 1
- Review: 1.90.0 VSCode Native PowerShell IntelliSense Issues HOT 5
- VS Code PowerShell Extension Fails to Load: Continuous Spinning Indicator and Console Prompt Absence HOT 2
- Intellisense for "[PSCustomObject]" leaves an extra close square bracket causing a syntax error HOT 2
- The PowerShell icon is not showing in the activity bar 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 vscode-powershell.