Title: Intellisense not behaving properly before class object is instantiated · Issue #1896 · PowerShell/PowerShellEditorServices · GitHub
Open Graph Title: Intellisense not behaving properly before class object is instantiated · Issue #1896 · PowerShell/PowerShellEditorServices
X Title: Intellisense not behaving properly before class object is instantiated · Issue #1896 · PowerShell/PowerShellEditorServices
Description: Prerequisites Write a descriptive title. Make sure you are able to repro it on the latest version Search the existing issues. Steps to reproduce class Person { [string]$Name [int]$Age = 999 Person([string]$name) { $this.Name = $name } Pe...
Open Graph Description: Prerequisites Write a descriptive title. Make sure you are able to repro it on the latest version Search the existing issues. Steps to reproduce class Person { [string]$Name [int]$Age = 999 Person(...
X Description: Prerequisites Write a descriptive title. Make sure you are able to repro it on the latest version Search the existing issues. Steps to reproduce class Person { [string]$Name [int]$Age = 999 Person(...
Opengraph URL: https://github.com/PowerShell/PowerShellEditorServices/issues/1896
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Intellisense not behaving properly before class object is instantiated","articleBody":"### Prerequisites\n\n- [X] Write a descriptive title.\n- [X] Make sure you are able to repro it on the latest version\n- [X] Search the existing issues.\n\n### Steps to reproduce\n\n```powershell\r\nclass Person {\r\n [string]$Name\r\n [int]$Age = 999\r\n\r\n Person([string]$name) {\r\n $this.Name = $name\r\n }\r\n\r\n Person([string]$name, [int]$age) {\r\n $this.Name = $name\r\n $this.Age = $age\r\n }\r\n\r\n [string]GetIntroduction([string]$greeting) {\r\n return \"$greeting $($this.Name)\"\r\n }\r\n\r\n [string]GetIntroduction([bool]$withAge) {\r\n return \"Hello $($this.Name) ($($this.Age))\"\r\n }\r\n}\r\n\r\n# 1. Run until this point. Don't execute the next lines\r\n# ctrl+space at end $p. to open intellisense.\r\n# Look at GetIntroduction (missing second overload) and Person (shouldn't be there)\r\n$p = [Person]::new(\"Frode\")\r\n$p.\r\n\r\n# 2. Execute next line\r\n$p = [Person]::new(\"Frode\")\r\n\r\n# 3. ctrl+space at end of next line and check again. both method overloads visible + no constructor as expected\r\n$p.\r\n```\n\n### Expected behavior\n\n```console\nIntellisense/completion shows the same step 3 at step 2\n```\n\n\n### Actual behavior\n\n```console\nDifference. Intellisense for members of `$p` include constructor and only first overload of methods. See images below\n```\n\n\n### Error details\n\n_No response_\n\n### Environment data\n\n```PowerShell\nName Value\r\n---- -----\r\nPSVersion 7.2.5\r\nPSEdition Core\r\nGitCommitId 7.2.5\r\nOS Linux 5.10.102.1-microsoft-standard-WSL2 #1 SMP Wed Mar 2 00:30:59 UTC 2022\r\nPlatform Unix\r\nPSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}\r\nPSRemotingProtocolVersion 2.3\r\nSerializationVersion 1.1.0.1\r\nWSManStackVersion 3.0\n```\n\n\n### Version\n\n2022.8.2 preview\n\n### Visuals\n\nConstructor is shown\r\n\r\n\r\nOnly first overload\r\n\r\n","author":{"url":"https://github.com/fflaten","@type":"Person","name":"fflaten"},"datePublished":"2022-08-16T20:04:34Z","url":"https://github.com/PowerShell/PowerShellEditorServices/issues/1896"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:99c661b2-79b2-4432-b636-b7d2af9ebac8 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C6A6:238BBD:524844:76E6D9:6AFD89BF |
| html-safe-nonce | d18822a290145c904b7521d4794fa83d7cfe4441a8c5efb5084304578e50bbeb |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDNkE2OjIzOEJCRDo1MjQ4NDQ6NzZFNkQ5OjZBRkQ4OUJGIiwidmlzaXRvcl9pZCI6IjU0MDkxNTYzNDkyMzk4NTU1NTEiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | fdf4894c9734ddd6c6d52d73139a6da6ee041c2c0a0bbf62ec686a5ea83658ca |
| hovercard-subject-tag | issue:1340820555 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/PowerShell/PowerShellEditorServices/1896/issue_layout |
| twitter:image | https://opengraph.githubassets.com/2881d9a66300155e258342726dcfa07e28af9a304956516116328e2bd93d27a8/PowerShell/PowerShellEditorServices/issues/1896 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/2881d9a66300155e258342726dcfa07e28af9a304956516116328e2bd93d27a8/PowerShell/PowerShellEditorServices/issues/1896 |
| og:image:alt | Prerequisites Write a descriptive title. Make sure you are able to repro it on the latest version Search the existing issues. Steps to reproduce class Person { [string]$Name [int]$Age = 999 Person(... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | fflaten |
| hostname | github.com |
| expected-hostname | github.com |
| None | bc86424ef34a73b386237872800e922d149d65ba907f63d6f150a2dcb8433bea |
| turbo-cache-control | no-preview |
| go-import | github.com/PowerShell/PowerShellEditorServices git https://github.com/PowerShell/PowerShellEditorServices.git |
| octolytics-dimension-user_id | 11524380 |
| octolytics-dimension-user_login | PowerShell |
| octolytics-dimension-repository_id | 36031537 |
| octolytics-dimension-repository_nwo | PowerShell/PowerShellEditorServices |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 36031537 |
| octolytics-dimension-repository_network_root_nwo | PowerShell/PowerShellEditorServices |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 927a6c5ab1c32b38830f1b9d3050c0b9e9aa92e1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width