Comments (3)
@333fred FYI
from roslyn.
API Review
- Could we just not use local functions here to make it easier?
- Would require more wrapping of C# that we don't want to introduce.
- Tokens aren't really understood by the compiler, and it seems odd that we'd return them.
- This seems like it would be a significant chunk of work
- There are other cases that would need to be considered, such as anonymous function symbols.
Conclusion: Needs work. We'll work offline to determine the future of the proposal.
from roslyn.
Tokens aren't really understood by the compiler, and it seems odd that we'd return them.
We do have ISymbol.MetadataToken
public API that returns token of a PE symbol, or 0 if the symbol isn't a PE symbol with a token.
The proposed API is essentially similar to the existing API, it would instead work on symbols defined in source. I agree we should not try to implement it for symbols that are emitted as implementation details. A rule of thumb could be to support it for definitions that are named in the code and have tokens (named type, method or local function, field, property, event, parameter, generic parameter symbol).
The Semantic Search scenario that uses local function is just one hosting scenario. In general hosting scenario a host application uses Roslyn compilation to emit assembly, then loads the assembly and then interacts with the loaded entities via Reflection. The mapping between ISymbol and the emitted metadata might get complicated. E.g. when the host needs to distinguish 2 method overloads, or needs to find a symbol whose name is mangled (local function, explicit interface implementation, etc.).
Note also that EmitDifferenceResult
, which derives from EmitResult
and is used for EnC returns handles (tokens) to the methods and types it emitted.
from roslyn.
Related Issues (20)
- IDE0036 not raised for `protected private` and `internal protected` members HOT 1
- Visual Studio 2022 adds a duplicate "Option Strict On" to Code File When Pasting VB.NET Code HOT 1
- Account for partial properties at existing use sites of partial method symbol APIs HOT 3
- Change Workspace.Option setter to throw NotSupportedException HOT 1
- Version conflict detected for Microsoft.CodeAnalysis.Common Microsoft.CodeAnalysis.CSharp HOT 2
- Adding documents to a VisualStudioWorkspace in a subfolder fails if folder doesn't exist HOT 7
- IDE0100 (Remove unnecessary equality operator) catches `x == false` as redundant HOT 9
- csc.exe hangs on specific file
- Filesystem pollution in `/tmp/` HOT 4
- Adding/Removing space when toggling line comments HOT 2
- Methods with Optional String Parameters Won't Collapse HOT 1
- Method defining line move when adding code before method declaration HOT 1
- Error list goes crazy while doing a refactoring HOT 1
- Version 17.10.0 Preview 5.0 - Error list not showing all warnings HOT 1
- VS 17.10.0 preview 4 shows warnings where no Error is. HOT 1
- C# Syntax highlighting of type references is broken HOT 7
- Custom modifiers are not copied in array type collection expression lowering
- Accessibility issue in document outline window. HOT 4
- Internal compiler crash when compiler diagnostic CS0103 is expected HOT 2
- Add documentation for TypeDefinitionDocument custom debug information
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 roslyn.