completions for attribute/type alias's inconsistent.
See original GitHub issueSystem Details
- Operating system name and version: Win 10 1809
- VS Code version: 1.33.1 (user)
- PowerShell extension version: 2.0.2
- PowerShell: 6.2.0
Issue Description
try:
Enter [PSDefaultValue]
, note the completion suggestion PSDefaultValueAttribute
, accept the completion, the value inserted is PSDefaultValue
. This is good.
Enter [Flags]
, note the completion suggestion FlagsAttribute
, accept the completion, the value actually inserted is System.FlagsAttribute
. I expected just Flags
.
Similar result for [Ordered]
.
EDIT: [PSCustomObject]
offers PSObject
and a snippet for ‘PSCustomObject’. Accepting the PSObject
actually inserts pscustomobject
which is kind of confusing.
Why the difference between the completions for these objects?
Issue Analytics
- State:
- Created 4 years ago
- Comments:6
Top Results From Across the Web
16.20 - 6842 Attribute type cannot be the type under creation or ...
2554 Inconsistent situation occurs in restart MLoad - %VSTR ... 3868 A table or view without alias appears more than once in FROM...
Read more >Web service error codes (Microsoft Dataverse) - Power Apps
Fix this inconsistency, and then import this data map again. 0x80040390 ... Field is not supported for MultiSelectPicklist Attribute Type.
Read more >DS 5 > Log Message Reference - ForgeRock Backstage
Message: An error occurred while trying to parse the completion time value %s ... Message: Unable to remove attribute type %s from the...
Read more >LDAP: The Protocol - IETF
Upon completion of the operation(s), the server returns a response ... Briefly, an attribute description is an attribute type and zero or more...
Read more >XSL Transformations (XSLT) Version 2.0 (Second Edition)
On completion of the xsl:apply-templates instruction, ... [Definition: A stylesheet can use the xsl:namespace-alias element to declare that ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@SeeminglyScience has already covered all the important points here, but to summarise:
[...]
syntaxSystem.
implicitly and looks again (notice that[object]
isn’t a type accelerator)[...()]
attribute syntax is used, it will also appendAttribute
and look again[psmoduleinfo]
or[semver]
), although a lot of these would already work with the implicitSystem.
(like[uri]
,[version]
and[char]
)[ordered]
doesn’t but[psobject]
does) but have specific semantic meaning.[ref]
is an interesting case here because it looks like a cast, but is used more like an attribute in C# (it works fine as a type accelerator though).These make life hard because the completion API has the naive assumption that type accelerators can be uniquely represented by their type name, but:
[psobject]
and[pscustomobject]
both point to the same type (even though they do different things)[ordered]
points to no type at all (it’s not actually a type accelerator even though it’s perfectly suited to be one), so you don’t even get a completion for it (even in the PowerShell console)!When PowerShell expects that the type should resolve to an
Attribute
, it will appendAttribute
to the type name if resolution fails without it.