Comments (5)
All the project types are implemented differently and some don't support nested files using the standard APIs in VS. It's pretty frustrating for extension authors because each extension has to be tested on ALL project types. Unfortunately I don't have the bandwidth to do all that testing.
I don't have the PHP extension installed, so I can't debug the issue. If you can debug it then please let me know what the problem is or feel free to send a PR. Thanks.
from filenesting.
Hi Mads,
The issue is not just with PHP Tools, but also with Python and NodeJs.
There are two problems:
Issue 1. i.Kind == VSConstants.ItemTypeGuid.PhysicalFile_string
Kind is however in our project system (and PTVS, NTVS) guid.ToString("B") returning lower-case guid string. VSConstants.ItemTypeGuid.PhysicalFile_string is upper-case
Issue 2. Nesting existing item with parent.ProjectItems.AddFromFile(path); is not working on these project systems when path is already existing in the hierarchy. But as it behaves like this in C# Proj.sys. we should probably behave the same way. I'll try to do something with this one.
Thanks!
from filenesting.
I've changed the i.kind to use GUID comparisons instead. That works for NTVS projects. However, as you mentioned, AddFromFile()
does nothing. I don't want to special case NTVS by deleting the file and then recreating it with the right nesting. That would lose file history etc. Is there another way to do it in NTVS projects?
from filenesting.
We need to do some work on our project system to be able to support this. As bad as things are for extension authors, it's also pretty horrible to be a tiny team trying to replicate everything that the huge teams have built up over years of development.
Is this feature using the same dependent files support that WinForms and WPF use? We have most of the support there for that, though apparently not the DTE function, but it can be done through the project file. I'm not sure we support nesting more than one file in this way though. Basically, it's quite a low priority for us, as both Python and Node.js rely on the view of the project matching the file system, so nesting files like this is not a common request.
PHP may be different and we'll always consider contributions (as you know, @Miloslav :) ), but we probably won't be able to get to it ourselves any time soon.
from filenesting.
Unfortunately I'm currently not aware of other method. However I'll take a look
Yes, it's the same. SharedProject system does support nesting, even more than one level. Just this method of adding a node which is already in the hierarchy through DTE doesn't work with us (adding a new node works correctly). Everything comes down to the insane function ProjectNode.AddItemWithSpecificInternal . I'll take a look at that to see if it can be somehow easily altered to support that, but as you know that method is scary :-)
from filenesting.
Related Issues (20)
- Is it possible to custom nesting rule?
- Feature request: auto-nester to nest culture specific .resx files under the neutral .resx file HOT 1
- Items in folders are not auto-nested
- Nesting items throws unspecified error
- .NET Standard (Core) projects not working! HOT 3
- Auto Nest .js and .map files under .ts files HOT 3
- Will .NET Core project types be supported in the near future HOT 4
- Nesting "blocked" after drag&drop to another folder
- Stopped working for me with latest VS update (15.6.1) HOT 4
- Nested file not saving changes when unnested
- Not working anymore on C# Shared Projects (since VS 15.8.1) HOT 1
- Can it work as every item is a folder ?
- Un-nest deletes code behind piece of WPF View.
- Nesting not working in VS 2019 16.3.1 or Preview 16.4.0 preview 1 HOT 2
- Item nested under wrong parent when the extension rule is enabled
- CopyToOutputDirectory is lost after nesting and unesting
- c++ enable nesting of cpp and header files
- Support for Visual Studio Mac? HOT 1
- VB Extension not right?
- Visual Studio 2022 Support HOT 7
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 filenesting.