text:
PowerToys connect to the internet without permission

Microsoft PowerToys version
"0.35.0"
Running as admin
Area(s) with issue?
General
Steps to reproduce
Start Power Toys.
Application tries to connect to somewhere.
✔ Expected Behavior
No initiated internet connections.
❌ Actual Behavior
Power Toys try to connect to 140.82.121.5.
Other Software
No response
This utility should not ever connect to anything without explicit permission, ie update check or something else.
There should be an update check, yes, but it should be togglable.
In addition, if there is the .NET runtime missing, don't just to blindly try to download it, ask for permission to do this. This is inpolite, not to ask for such permissions to do so.

@shakeyourbunny We're fully open source and you can see exactly what happens E2E :)

140.82.121.5 is GitHub IP, that is us every 24 hours seeing if there is an update.

This is still not a v1 piece of software yet, we want people on the latest to reduce support issues.
This behavior is no different than most software.  More so with an pre-release software.
We could have a toggle but this would be post stability push.

Good feedback but our readme does clearly state this is a requirement. By installing, you've made the choice to get the needed requirements to run the software. We are thinking about that in #10126 for a install better experience but opt'ing out would cancel install then as a required dependency.  If you have the up-to-date version installed, it doesn't download.

authors: crutkas shakeyourbunny

repo: microsoft/PowerToys


text:
Video Mute doesn't work as intended

Microsoft PowerToys version
0.49.1
Running as admin

[X] Yes

Area(s) with issue?
Video Conference Mute
Steps to reproduce

Open PowerToys from Taskbar
Click on the Video Conference Mute Tab
Under the camera segment, click the Browse button under Camera overlay image sub-segment

https://user-images.githubusercontent.com/39209052/139534385-0afae517-921e-4960-a1fa-de6f3f68c596.mp4
✔ Expected Behavior
A File Chooser which will let me select the overlay image to be shown when the camera is muted.
❌ Actual Behavior
Nothing happens and the button is unresponsive.
Other Software
No response

Duplicate of #14018

Thanks for reporting this. This issue is a duplicate.
I'm linking this issue to #14018 to centralize the discussion thread for tracking.
Thanks for your help to make PowerToys a better piece of software!

source: gharchive/issue

license: MIT

license_type: permissive

license_source: github-api


text:
No Possible OCR languages are installed

Microsoft PowerToys version
0.62.0
Running as admin

[X] Yes

Area(s) with issue?
TextExtractor
Steps to reproduce
Press Window + Shift + T and then select a screen area with text
✔ Expected Behavior
It should copy the text to clipboard
❌ Actual Behavior
It gives this error

"No Possible OCR languages are installed"

Other Software
No response

@jaimecbernardo, seeing a lot of similar issues, I think we should query a list of language packs installed and display them on the Text Extractor settings page, and show a warning if no language was installed. We could also introduce a dropdown setting for a preferred recognized language for non-English users and try to use it first before falling back to English.

fyi @yuyoyuppe, I am scanning English text and my PC language is also English, but still I see this error.

Here it is

And here's the GIF to see exact behavior for me https://jumpshare.com/v/QRHb3YcNfp9nveqPBmOA

@dotriz can you try temporarily removing "English (Pakistan)" pack and give it a test? Thanks.

Same behavior. See https://jumpshare.com/v/td6c41H2h1bmRMBEThJV

@dotriz, when English (United States) language is installed, then OCR pack should be installed alongside.
Could you please run next command from the Powershell in administrator mode:
PS C:\Windows\system32> Get-WindowsCapability -Online | Where-Object { $_.Name -Like 'Language.OCR*' }
It shout show you the status of the installed OCR packages, like:
Name  : Language.OCR~~~el-GR~0.0.1.0
State : NotPresent

Name  : Language.OCR~~~en-GB~0.0.1.0
State : NotPresent

Name  : Language.OCR~~~en-US~0.0.1.0
State : Installed

Name  : Language.OCR~~~es-ES~0.0.1.0
State : NotPresent

Name  : Language.OCR~~~es-MX~0.0.1.0
State : NotPresent

I just ran the command. All are showing NotPresent except Language.OCR~~~en-US~0.0.1.0

Do you still see "No Possible OCR languages are installed" message?

Yes, I still see that

Thank you. Could you please send your Windows build version from system information, like:

Here it is

Thank you. @dotriz, could you please run next commands in admin powershell and send us the output:
PS C:\Windows\system32> $null = [Windows.Media.Ocr.OcrEngine,                Windows.Foundation,      ContentType = WindowsRuntime]
PS C:\Windows\system32> [Windows.Media.Ocr.OcrEngine]::AvailableRecognizerLanguages

No output

That's the reason. TextExtrator show this message if there is no languages with OCR support.
However, this function should return en-US language, cause OCR for language en-US language is installed according to your comment above.
I can only suggest try to remove/add languages until this [Windows.Media.Ocr.OcrEngine]::AvailableRecognizerLanguages returns non-empty result.
You may also try remove and then add the OCR pack via powershell in admin.
For example, for en-US language:
PS C:\Windows\system32> $Capability = Get-WindowsCapability -Online | Where-Object { $_.Name -Like 'Language.OCR*en-US*' }
PS C:\Windows\system32> $Capability | Remove-WindowsCapability -Online
PS C:\Windows\system32> $Capability | Add-WindowsCapability -Online

PS C:\Windows\system32> $Capability = Get-WindowsCapability -Online | Where-Object { $_.Name -Like 'Language.OCR*en-US*' }
PS C:\Windows\system32> $Capability | Remove-WindowsCapability -Online
PS C:\Windows\system32> $Capability | Add-WindowsCapability -Online

After running these commands OcrEngine seems to have uninstalled. And by running this command [Windows.Media.Ocr.OcrEngine]::AvailableRecognizerLanguages I get this error
Unable to find type [Windows.Media.Ocr.OcrEngine].

It's needed to run both commands:
PS C:\Windows\system32> $null = [Windows.Media.Ocr.OcrEngine,                Windows.Foundation,      ContentType = WindowsRuntime]
PS C:\Windows\system32> [Windows.Media.Ocr.OcrEngine]::AvailableRecognizerLanguages

OK. Still blank result

Thank you. I'll try to figure out what could be the issue there, but it's definitely out of PowerToys scope.
Meanwhile you may try different things like restart, change language configuration and see what's the [Windows.Media.Ocr.OcrEngine]::AvailableRecognizerLanguages output.

FYI, I installed English UK language, made it default. Restarted. But still I get the same result

Thank you for information. It's helpful, we will take it into account.

same issue here. I am using english windows, the text is in Chinese

I see that [Windows.Media.Ocr.OcrEngine]::AvailableRecognizerLanguages queries the C:\Windows\OCR path and very likely it checks which OCR packs are available and returns them.

@dotriz, could you please run the next command in powershell on your machine and provide the output:
PS C:\> ls -Recurse C:\Windows\OCR

updated powertoys today, still same issue.

@oijqws, could you please send the screenshot like one above: https://github.com/microsoft/PowerToys/issues/20388#issuecomment-1249485896?

@dotriz just curious. Could you please try to copy G:\Windows\OCR to the C:\Windows\OCR and run https://github.com/microsoft/PowerToys/issues/20388#issuecomment-1245328942 again?

Hurray @teras-janea, this works and solves the issue❤

@dotriz just curious. Could you please try to copy G:\Windows\OCR to the C:\Windows\OCR and run https://github.com/microsoft/PowerToys/issues/20388#issuecomment-1245328942 again?

same issue here. I am using Chinese windows, the text is in Chinese.Could you help me? @taras-janea

The issiue was the windows is not installed on C drive? Can you fix it? I haven't C drive on my desktop.

@dotriz just curious. Could you please try to copy G:\Windows\OCR to the C:\Windows\OCR and run #20388 (comment) again?

Is it possible for us to change where it's searching in the registry? As I none of my drives are considered the C drive, but I do have the OCR folder in my windows folder on my main drive, as well as everything else checking out from running the commands besides the same issues OP had.
I'll see if it's possible to change the path its looking for in registry..  Haven't been able to find anything.

authors: Yushu12138 blue-codes-yep dczyzowski dotriz oijqws taras-janea yuyoyuppe


text:
Need stability in PowerToys Run in Windows 11

Description of the new feature / enhancement
i think this is very important tool to used, i need this feature stability and more deep searching.
Scenario when this would be used?
i am installing powertoys and set enable in startup, but i have to set manualy again to activate this feature while i will use.
Supporting information
No response

/reportbug

authors: KaitouOim crutkas


text:
Search for available updates

Description of the new feature / enhancement
Add the option to disable automatic updates.
Is annoying to always have this message. It would be great to do this myself when I need it.
Scenario when this would be used?
It distracts from the work your doing and it's disturbing.
Supporting information
No response

/dup #2701


text:
Peek: wrong German translation (pin window)

Microsoft PowerToys version
0.70.0
Utility with translation issue
Peek
🌐 Language affected
German
❌ Actual phrase(s)

Fenster an aktuellen Speicherort anheften
✔ Expected phrase(s)
Fenster an aktueller Position anheften
ℹ Why is the current translation wrong
location should be translated to Ort or Position
Speicherort means "save location" (file system)

https://microsoft.visualstudio.com/OS/_workitems/edit/44976286 /loc

this should be fixed in 0.71.  possible to verify?  /needinfo

authors: Throneos crutkas


text:
Visual Search

Description of the new feature / enhancement
Selecting an area, no matter where one's on the screen to trigger visual search with selected Search Engine (Bing/Google) for one to be able to track source of the picture, and view or download other relevant images.
This would be great if results are displayed on the same screen where visual is selected from with help of a side pane.
Scenario when this would be used?
While going through a visual content on screen to find out the source and relevant results.
Supporting information
No response

neat idea but no plans

authors: Viralayer crutkas


text:
Cannot modify svg files on network if preview is enabled

Microsoft PowerToys version
0.71
Installation method
GitHub
Running as admin
No
Area(s) with issue?
File Explorer: Preview Pane
Steps to reproduce
Enable svg preview, open a folder on a network location, try to delete an svg file.
It either will produce an error message, stating the file is open in Windows Explorer, or the file seemingly disappears only to reappear on refresing the folder.
The issue is the same as in #16699 but it only happens to files on a network share. We use a Samba share on a FreeBSD server, but I've tried it on a Linux server, and even in a shared folder on a Windows 10 machine.
✔ Expected Behavior
Able to modify or delete files
❌ Actual Behavior
Unable to modify or delete file as Preview handles them
Other Software
No response

Are you still experiencing this issue? /needinfo

authors: LenryNmQ cinnamon-msft


text:
Requesting an option to turn on or off monitors with hotkeys (in extend mode)

Description of the new feature / enhancement
Press hotkey to enable a custom monitor layout.
Scenario when this would be used?
My default extend mode has all my external monitors turn on. Sometimes I just want a specific monitor to turn on without changing my default extend settings. Say I want my main + a smaller one, instead of all the other monitors turning on.
Supporting information
No response

应该微软来实现

authors: mangaroo yajiegithub


text:
[Settings V2] Hotkey input not working for all keys

Environment
Windows build number: 10.0.18363.*
PowerToys version: 0.18.0
PowerToy module for which you are reporting the bug (if applicable): SettingsV2

Description
I can't specify every shortcut in the shortcut input of "Settings V2". I have various problems.
I use the german keyboard layout!
Steps to reproduce
Select hotkey field and press the following hotkeys:

esc
win + v (example)

Expected behavior
The hotkey will be set.
Actual behavior

Hotkey
Result

esc
shortcut input field shows "undefined"

win+v
shortcut action gets triggered but the shortcut input field doesn't change

Screenshots
The example here is for PowerToys Run, but the issue exists on other settings page.

@jyuwono This is not only on PowerToys Run settings. This happens also on other settings pages. For example FancyZoones.
Please correct label and title of the issue.

@htcfreek apologies, I misunderstood the issue. I've changed it back to Settings issue. Thanks for filing the feedback!

Any known workarounds? My hotkey field says undefined and I cannot change it.

Any known workarounds? My hotkey field says undefined and I cannot change it.

You can change it by not using esc or win key. For example Ctrl + R.

@crutkas
I think we should fix this in the hotfix too. Thoughts?

This is being tracked for in #2325 which is too large for a hotfix

This is being tracked for in #2325 which is too large for a hotfix

This is not a launcher problem. I have this problem on all key input fields.

If the shortcut is mapped by Windows OS I am not able to enter it and the field become "undefined".
If I enter a shortcut which includes ESC the shortcut not changes.

This is being tracked by #2325 which is the larger work item.

authors: PatrickdeBie crutkas htcfreek jyuwono


text:
Windows hotkeys conflict with Powertoys's, even after changing the latter

Microsoft PowerToys version
0.81.0
Installation method
GitHub
Running as admin
Yes
Area(s) with issue?
Always on Top, ColorPicker, Peek, PowerToys Run, Screen ruler, Shortcut Guide
Steps to reproduce

Open PowerToys
Either leave the default shortcut for one module, or change it

For the Always on Top module :

Open File Explorer
Go in a folder containing images
Select an image
Use the shortcut

For the PowerToys Run module :

Go back on the desktop by clicking on the bottom right corner of the screen
Use the shortcut

✔ Expected Behavior
PowerToys functions work as they should.
❌ Actual Behavior
Either PowerToys shortcuts don't do anything, or identical Windows shortcuts (like Win + Space, to change the keyboard's layout, initially associated with PowerToys Run) work instead
Other Software
No response

Hi I'm an AI powered bot that finds similar issues based off the issue title.
Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it. Thank you!
Closed similar issues:
* [Shortcuts not working (#29184)](https://github.com/microsoft/PowerToys/issues/29184),  similarity score: 0.80

* [Keyboard shortcuts incompatibility (#26518)](https://github.com/microsoft/PowerToys/issues/26518),  similarity score: 0.79

* [Always on top - already mapped hotkey are not working (#16983)](https://github.com/microsoft/PowerToys/issues/16983),  similarity score: 0.78

* [[Always On Top] Cannot use Win + Space as shortcut (#15621)](https://github.com/microsoft/PowerToys/issues/15621),  similarity score: 0.78

* [Power Toys hotkey doesn't overrides system hotkey (#4938)](https://github.com/microsoft/PowerToys/issues/4938),  similarity score: 0.77

Note: You can give me feedback by thumbs upping or thumbs downing this comment.

None of these help me unfortunately


text:
Input Lag Due to Keyboard Manager

Environment
Windows build number: [10.0.18363.900]
PowerToys version: v0.18.2
PowerToy module for which you are reporting the bug (if applicable): Keyboard Manager

Steps to reproduce
*Have Keyboard Manager Enabled
*Use Keyboard and record keystroke input vs registration on computer
*Potentially have intensive tasks running: Issue was initially noticed when playing the shooter game Valorant, but not as noticeable when performing other normal tasks.
Expected behavior
*Keystrokes register on computer at the same time as registered on keyboard
Actual behavior
*Input delay lasting multiple seconds.
Screenshots

Hi @thesaadsalman, how many key/shortcut remappings did you have? Not sure if this could be happening because of Valorant's new anti cheat which runs at the driver level for some reason conflicting with Keyboard Manager.

*Use Keyboard and record keystroke input vs registration on computer

Do you mean just pressing/keys in some text editor or something like that?

*Potentially have intensive tasks running: Issue was initially noticed when playing the shooter game Valorant, but not as noticeable when performing other normal tasks.

Is it only happening for Valorant or even other games? And when you say its not as noticeable when performing other normal tasks, are you still able to feel the delay?

I didn't have any key/shortcut re-mappings.
Keys in a text editor didn't really seem to show the issue - when outside of Valorant specifically I did not notice any delay on keystrokes. I'll test out the issue in some other games and get back to you.

Follow-Up: I tried some other games and didn't notice any input lag issues in them, so this could be centralized to Valorant possibly. Also, it seems like it isn't just an issue with Keyboard Manager, as the issue still persisted, just not to as high a degree, unless I fully turned off the program via Task Manager.

marking closed no repro then

I am sorry to comment on a closed issue, but I have been able to successfully reproduce your problem - not only that, but it happens every time I boot my computer. It stops once PowerToys has been stopped via Task Manager.

@GabrielTK  please create a new issue so we can't follow up and get updated details

@GabrielTK, I noticed that as well. Could you link your issue so I don't open a duplicate? In my case, it happens on a game as well and the lag depends on how long you were pressing a key.
Lets say you need to go forward. Just touch W and release, it will do as intended. But if you hold W and release after a while, the character will keep going forward for longer than should.
Also, if you are going forward and then hit a key for jumping, it will take some time to register the jump, while if you are still, it would jump almost immediately.
Both Keyboard Manager and Shortcut Guide are off. I downloaded PowerToys for the first time today, so I'm on the latest version (0.36)
I had this issue before without PowerToys on another PC and on another game. It seems that the game is registering holding down the key as repeatedly hitting the key instead of just holding down, which ends up putting the commands in a sort of queue that slows down the processing. Not sure if this is what PowerTools is doing to the game though. Might be a clue.

this happens to me too, it really only happens when i'm using a lot of my cpu like if i'm playing rainbow six siege or minecraft with shaders. i fixed it by closing powertoys but i don't like doing that

Reviving this closed issue.
a consistent way to repro is open a notepad. and start smashing as many keys are you can, the stutter/delay will happen once in a while, normally 10sec+ but less than 30 secs.
Keyboard + manager = Razer Huntsman Elite + Razer Synapse.
Once powertoys is closed. issue is gone. Reopened, issue returns.

I've seen this too, during intensive writing sessions and playing Overwatch. I don't have any mappings but the option was enabled. I have done gaming only after closing all apps as soon as I noticed it but I think I have now narrowed it down to PowerToys.

authors: GabrielTK PjayFox ThenewzzZZ arjunbalgovind bergamin crutkas ronilaukkarinen thesaadsalman


text:
[PowerToys Run] setting keyword to open specific file or application

📝 Provide a description of the new feature
What is the expected behavior of the proposed feature?  What is the scenario this would be used?
I can set the keyword bind to specific file or application, and can open quickly by typing into keyword
If you'd like to see this feature implemented, add a 👍 reaction to this post.

Good idea, Tracked in https://github.com/microsoft/PowerToys/issues/3600

authors: crutkas linlih


text:
[Settings] Fix "What's new" icon

Summary of the Pull Request

Changed icon so it was not the same as the Welcome item, addressing: #30482

Fixed alphabetical ordering of File Explorer Preview and File Locksmith

General icon is now animating addressing: https://github.com/microsoft/PowerToys/issues/30525

PR Checklist

[x] Closes: #30525, #30482
[ ] Communication: I've discussed this with core contributors already. If work hasn't been agreed, this work might be rejected
[ ] Tests: Added/updated and all pass
[ ] Localization: All end user facing strings can be localized
[ ] Dev docs: Added/updated
[ ] New binaries: Added on the required places

[ ] JSON for signing for new binaries
[ ] WXS for installer for new binaries and localization folder
[ ] YML for CI pipeline for new test projects
[ ] YML for signed pipeline

[ ] Documentation updated: If checked, please file a pull request on our docs repo and link it here: #xxx

Detailed Description of the Pull Request / Additional comments

Validation Steps Performed

Hey Niels, you forgot the icon inside of the OOBE window 🙃

source: gharchive/pull-request


text:
To remove the condition that space is needed after the Action keyword

Summary of the Pull Request
What is this about?
This PR removes the requirement that space is needed after the action keyword.
PR Checklist

[x] Applies to #3212.
[x] CLA signed. If not, go over here and sign the CLA
[x] Tests added/passed
[ ] Requires documentation to be updated
[ ] I've discussed this with core contributors already. If not checked, I'm ready to accept this work might be rejected in favor of a different grand plan. Issue number where discussion took place: #xxx

Info on Pull Request
What does this include?
The following changes have been made in this PR -

Previously, there was only one query being sent to all the plugins. If the first space separated item was an action keyword, then only a non global query would be executed. However, now we have a query being generated for each plugin. We execute global plugins along with the non global plugins as we have removed the space requirement following the action keyword.
A few symbols have been added to the search ignore regex of the indexer plugin. The symbols which have been added are >, < and : because when we search for >cmd, the indexer plugin is also executed now and it compared the filenames and returns those which are greated than cmd. This was leading to a delay. Also, filenames do not contain these symbols >, < and :. Hence queries containing these symbols can be ignored.
Previously the cancellation token was based on the query, however since we have a unique query for each plugin, the cancellation token is based on the queryText instead which is same for all plugins.

Validation Steps Performed
How does someone test & validate?

Added  tests
manually validated it

Previously, there was only one query being sent to all the plugins. If the first space separated item was an action keyword, then only a non global query would be executed. However, now we have a query being generated for each plugin. We execute global plugins along with the non global plugins as we have removed the space requirement following the action keyword.
A few symbols have been added to the search ignore regex of the indexer plugin. The symbols which have been added are >, < and : because when we search for >cmd, the indexer plugin is also executed now and it compared the filenames and returns those which are greated than cmd. This was leading to a delay. Also, filenames do not contain these symbols >, < and :. Hence queries containing these symbols can be ignored.

@SeraphimaZ

You wrote that you added the : to the search ignore list. Do we get in trouble with this change when users search for files by file path?

You wrote that you got the result cmd.exe while typing >cmd because of removing the blank requirement.
Can we do it instead like the following way to avoid adding more symbols to the black list: We generate a list of all action keywords and plugin pairs. If we find one or more of the keywords within the pair list at the beginning of the search query, we only send the search query to the corresponding plugin of the pair list. Then we don't have to send the query to all plugins. To distinguish the words for action keywords from search text for plugins we could have the requirement of an colon between keyword and search query.

Previously, there was only one query being sent to all the plugins. If the first space separated item was an action keyword, then only a non global query would be executed. However, now we have a query being generated for each plugin. We execute global plugins along with the non global plugins as we have removed the space requirement following the action keyword.
A few symbols have been added to the search ignore regex of the indexer plugin. The symbols which have been added are >, < and : because when we search for >cmd, the indexer plugin is also executed now and it compared the filenames and returns those which are greated than cmd. This was leading to a delay. Also, filenames do not contain these symbols >, < and :. Hence queries containing these symbols can be ignored.

@alekhyareddy28

You wrote that you added the : to the search ignore list. Do we get in trouble with this change when users search for files by file path?
According to windows the file path cannot contain a : so we will not get into any issue there. Rather we wouldbe removing unnecessary queries being sent to the indexer plugin. This was added not to blacklist a symbol but rather to improve the performance of the indexer query by removing redundant queries.

You wrote that you got the result cmd.exe while typing >cmd because of removing the blank requirement.
Can we do it instead like the following way to avoid adding more symbols to the black list: We generate a pair list of all action keywords and corresponding plugins. If we find one or more of the keywords on the pair list at the beginning of the search query, we only send the search query to the corresponding plugins of the pair list. Then we don't have to send the query to all plugins. To distinguish the words (not single action chars) for action keywords from search text for plugins we could have the requirement of an colon between keyword and search query. This means for example: >cmd or folder:windows.

I'm not sure if I understand clearly but cmd.exe does not show up on searching for >cmd.

Unfortunately the approach you are suggesting will not work if we set a character/set of characters as an action keyword, because then we wouldn't be able to search for programs starting with those characters.
We can have a colon as you suggested but that defeats the purpose of removing the space. If we were to set a colon then we could instead leave the space as is to not complicate how it works.
We can always tweak the working based on user feedback later.

According to windows the file path cannot contain a : so we will not get into any issue there. Rather we wouldbe removing unnecessary queries being sent to the indexer plugin. This was added not to blacklist a symbol but rather to improve the performance of the indexer query by removing redundant queries.

@alekhyareddy28 what about if the user searches for D:\fileName.txt? Or something like that with the drive letter. That would have : in it.

Thanks for pointing that out. Yes, you're right. I misinterpreted this article. These characters are not allowed in the filename and not file path. I removed the : condition. Ideally that would be captured by the folder plugin as well but there may be a partial match with the filename leading to the result showing up.

Thanks for pointing that out. Yes, you're right. I misinterpreted this article. These characters are not allowed in the filename and not file path. I removed the : condition. Ideally that would be captured by the folder plugin as well but there may be a partial match with the filename leading to the result showing up, so we should check the indexer plugin as well when the full path is not provided.

I know, that I can search for files in folders with the folder plugin.

@alekhyareddy28 I'm getting the following exception.  Typing the above for me and deleting over several times seems to repro.

This is the sql query:
SELECT TOP 30 "System.ItemUrl", "System.FileName", "System.FileAttributes", "System.ItemPathDisplay" FROM "SystemIndex" WHERE (Scope = 'file:C:/' AND CONTAINS(System.FileName,'"C:\repos*"',1033)) AND scope='file:' AND System.FileAttributes <> SOME BITWISE 2 ORDER BY System.DateModified DESC
Not sure if this  is related to the ':' character discussion previous in this thread.  I'll try to repro on master.

@arjunbalgovind, @ryanbodrug-microsoft this branch has the latest changes from master.
https://github.com/microsoft/PowerToys/blob/e8834529e08088cd92dacc8acfbc592183c4ab77/src/modules/launcher/Plugins/Microsoft.Plugin.Indexer/SearchHelper/OleDBSearch.cs#L56
It's related to the changes made in these PRs-
https://github.com/microsoft/PowerToys/pull/5748
https://github.com/microsoft/PowerToys/pull/5912
We have a catch statement though, so I'm not sure why it would crash.

@arjunbalgovind, @ryanbodrug-microsoft this branch has the latest changes from master.
https://github.com/microsoft/PowerToys/blob/e8834529e08088cd92dacc8acfbc592183c4ab77/src/modules/launcher/Plugins/Microsoft.Plugin.Indexer/SearchHelper/OleDBSearch.cs#L56
It's related to the changes made in these PRs-
#5748
#5912
We have a catch statement though, so I'm not sure why it would crash.

@alekhyareddy28 / @arjunbalgovind System.AccessViolation exceptions are not handled in catch blocks if the memory not managed by the common language runtime.  I've created an issue #6050 here and have a fix incoming.

authors: alekhyareddy28 arjunbalgovind htcfreek ryanbodrug-microsoft


text:
Prebuilt docker image does not work

Describe the bug
Starting from SynapseML website and launching container with a pre-built docker image, nothing appears on the localhost, I am using Ubuntu 20.04.
Container does not log anything (this is unusual) but it is up and run.
To Reproduce
Following docs try to run on terminal:
docker run -it -p 8888:8888 -e ACCEPT_EULA=yes mcr.microsoft.com/mmlspark/release

What I obtain is a bash open in a folder notebooks like:
root@c9711d3de3f8:/notebooks#

Expected behavior
As documentation says: I could run some sample notebooks at the port 8888, but nothing appears.
Info (please complete the following information):

SynapseML Version: latest on mcr.microsoft.com/mmlspark/release
OS : Ubuntu 20.04

Stacktrace
No stacktrace is available because there are no logs.
Additional context
Inside the notebooks folder there are some contents, listed here:
.
`-- features
    |-- classification
    |   |-- Classification\ -\ Adult\ Census\ with\ Vowpal\ Wabbit.ipynb
    |   |-- Classification\ -\ Adult\ Census.ipynb
    |   |-- Classification\ -\ Before\ and\ After\ SynapseML.ipynb
    |   `-- Classification\ -\ Twitter\ Sentiment\ with\ Vowpal\ Wabbit.ipynb
    |-- cognitive_services
    |   |-- CognitiveServices\ -\ Celebrity\ Quote\ Analysis.ipynb
    |   |-- CognitiveServices\ -\ Create\ a\ Multilingual\ Search\ Engine\ from\ Forms.ipynb
    |   |-- CognitiveServices\ -\ Overview.ipynb
    |   `-- CognitiveServices\ -\ Predictive\ Maintenance.ipynb
    |-- lightgbm
    |   `-- LightGBM\ -\ Overview.ipynb
    |-- onnx
    |   `-- ONNX\ -\ Inference\ on\ Spark.ipynb
    |-- opencv
    |   `-- OpenCV\ -\ Pipeline\ Image\ Transformations.ipynb
    |-- other
    |   |-- AzureSearchIndex\ -\ Met\ Artworks.ipynb
    |   |-- ConditionalKNN\ -\ Exploring\ Art\ Across\ Cultures.ipynb
    |   |-- CyberML\ -\ Anomalous\ Access\ Detection.ipynb
    |   |-- DeepLearning\ -\ BiLSTM\ Medical\ Entity\ Extraction.ipynb
    |   |-- DeepLearning\ -\ CIFAR10\ Convolutional\ Network.ipynb
    |   |-- DeepLearning\ -\ Flower\ Image\ Classification.ipynb
    |   |-- DeepLearning\ -\ Transfer\ Learning.ipynb
    |   |-- HyperParameterTuning\ -\ Fighting\ Breast\ Cancer.ipynb
    |   |-- TextAnalytics\ -\ Amazon\ Book\ Reviews\ with\ Word2Vec.ipynb
    |   `-- TextAnalytics\ -\ Amazon\ Book\ Reviews.ipynb
    |-- regression
    |   |-- Regression\ -\ Auto\ Imports.ipynb
    |   |-- Regression\ -\ Flight\ Delays\ with\ DataCleaning.ipynb
    |   |-- Regression\ -\ Flight\ Delays.ipynb
    |   `-- Regression\ -\ Vowpal\ Wabbit\ vs.\ LightGBM\ vs.\ Linear\ Regressor.ipynb
    |-- responsible_ai
    |   |-- DataBalanceAnalysis\ -\ Adult\ Census\ Income.ipynb
    |   |-- Interpretability\ -\ Explanation\ Dashboard.ipynb
    |   |-- Interpretability\ -\ Image\ Explainers.ipynb
    |   |-- Interpretability\ -\ Snow\ Leopard\ Detection.ipynb
    |   |-- Interpretability\ -\ Tabular\ SHAP\ explainer.ipynb
    |   `-- Interpretability\ -\ Text\ Explainers.ipynb
    |-- spark_serving
    |   `-- SparkServing\ -\ Deploying\ a\ Classifier.ipynb
    `-- vw
        `-- Vowpal\ Wabbit\ -\ Overview.ipynb

11 directories, 33 files

Probably this issue should be linked with the #1280, feel free to merge the issue or close this reporting this info the #1280 .

Once the docker container instance is started, run jupyter lab from the /notebooks directory and open browser to http://127.0.0.1:8888/lab on the host and you will be able to play with the notebooks.

authors: FrancescoMalluzzo memoryz

repo: microsoft/SynapseML


text:
docs: add aisample title genre text classification

Related Issues/PRs

None
What changes are proposed in this pull request?
Add a title genre text classification notebook for aisample under notebooks/community/aisample.
How is this patch tested?

[ ] I have written tests (not required for typo or doc fix) and confirmed the proposed feature/bug-fix/change works.

Does this PR change any dependencies?

[x] No. You can skip this section.
[ ] Yes. Make sure the dependencies are resolved correctly, and list changes here.

Does this PR add a new feature? If so, have you added samples on website?

[x] No. You can skip this section.
[ ] Yes. Make sure you have added samples following below steps.

Find the corresponding markdown file for your new feature in website/docs/documentation folder.
Make sure you choose the correct class estimators/transformers and namespace.
Follow the pattern in markdown file and add another section for your new API, including pyspark, scala (and .NET potentially) samples.
Make sure the DocTable points to correct API link.
Navigate to website folder, and run yarn run start to make sure the website renders correctly.
Don't forget to add <!--pytest-codeblocks:cont--> before each python code blocks to enable auto-tests for python samples.
Make sure the WebsiteSamplesTests job pass in the pipeline.

AB#1935137

Thanks @mhamilton723 for the feedbacks. They helped a lot :-)
Just TextFeaturizer is not applied. The output column only contains indexes of words, not the words. Thus we can't use the output df for plotting word cloud. Moreover, we want to apply word2vec for vectorization. It seems that TextFeaturizer doesn't support it.

/azp run

Codecov Report

Merging #1617 (63ce5a6) into master (7e90d19) will decrease coverage by 77.65%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##           master   #1617       +/-   ##
==========================================
- Coverage   83.72%   6.07%   -77.66%
==========================================
  Files         292     276       -16
  Lines       15473   14509      -964
  Branches      752     752
==========================================
- Hits        12955     881    -12074
- Misses       2518   13628    +11110

Impacted Files
Coverage Δ

...m/src/main/scala/com/microsoft/lightgbm/SWIG.scala
0.00% <0.00%> (-100.00%)
:arrow_down:

...a/com/microsoft/azure/synapse/ml/stages/udfs.scala
0.00% <0.00%> (-100.00%)
:arrow_down:

.../org/apache/spark/ml/LimeNamespaceInjections.scala
0.00% <0.00%> (-100.00%)
:arrow_down:

...m/microsoft/azure/synapse/ml/vw/VectorZipper.scala
0.00% <0.00%> (-100.00%)
:arrow_down:

...rg/apache/spark/injections/BlockManagerUtils.scala
0.00% <0.00%> (-100.00%)
:arrow_down:

.../microsoft/azure/synapse/ml/io/binary/Binary.scala
0.00% <0.00%> (-100.00%)
:arrow_down:

.../microsoft/azure/synapse/ml/lime/BreezeUtils.scala
0.00% <0.00%> (-100.00%)
:arrow_down:

.../microsoft/azure/synapse/ml/param/ModelParam.scala
0.00% <0.00%> (-100.00%)
:arrow_down:

.../microsoft/azure/synapse/ml/param/UDPyFParam.scala
0.00% <0.00%> (-100.00%)
:arrow_down:

...microsoft/azure/synapse/ml/codegen/Wrappable.scala
0.00% <0.00%> (-100.00%)
:arrow_down:

... and 266 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

/azp run

authors: codecov-commenter mhamilton723 thinkall


text:
SAP Portal Solutions

This PR contains managed and unmanaged solutions zip files for SAP Portal Custom solution and SAP Portal Metadata.

@sachingoyalms please read the following Contributor License Agreement(CLA). If you agree with the CLA, please reply with the following information.
@microsoft-github-policy-service agree [company="{your company}"]

Options:

(default - no company specified) I have sole ownership of intellectual property rights to my Submissions and I am not making Submissions in the course of work for my employer.

@microsoft-github-policy-service agree

(when company given) I am making Submissions in the course of work for my employer (or my employer has intellectual property rights in my Submissions by contract or applicable law). I have permission from my employer to make Submissions and enter into this Agreement on behalf of my employer. By signing below, the defined term “You” includes me and my employer.

@microsoft-github-policy-service agree company="Microsoft"

Contributor License Agreement
Contribution License Agreement
This Contribution License Agreement (“Agreement”) is agreed to by the party signing below (“You”), and conveys certain license rights to Microsoft Corporation and its affiliates (“Microsoft”) for Your contributions to Microsoft open source projects. This Agreement is effective as of the latest signature date below.

Definitions.
“Code” means the computer software code, whether in human-readable or machine-executable form,
that is delivered by You to Microsoft under this Agreement.
“Project” means any of the projects owned or managed by Microsoft and offered under a license
approved by the Open Source Initiative (www.opensource.org).
“Submit” is the act of uploading, submitting, transmitting, or distributing code or other content to any
Project, including but not limited to communication on electronic mailing lists, source code control
systems, and issue tracking systems that are managed by, or on behalf of, the Project for the purpose of
discussing and improving that Project, but excluding communication that is conspicuously marked or
otherwise designated in writing by You as “Not a Submission.”
“Submission” means the Code and any other copyrightable material Submitted by You, including any
associated comments and documentation.
Your Submission. You must agree to the terms of this Agreement before making a Submission to any
Project. This Agreement covers any and all Submissions that You, now or in the future (except as
described in Section 4 below), Submit to any Project.
Originality of Work. You represent that each of Your Submissions is entirely Your original work.
Should You wish to Submit materials that are not Your original work, You may Submit them separately
to the Project if You (a) retain all copyright and license information that was in the materials as You
received them, (b) in the description accompanying Your Submission, include the phrase “Submission
containing materials of a third party:” followed by the names of the third party and any licenses or other
restrictions of which You are aware, and (c) follow any other instructions in the Project’s written
guidelines concerning Submissions.
Your Employer. References to “employer” in this Agreement include Your employer or anyone else
for whom You are acting in making Your Submission, e.g. as a contractor, vendor, or agent. If Your
Submission is made in the course of Your work for an employer or Your employer has intellectual
property rights in Your Submission by contract or applicable law, You must secure permission from Your
employer to make the Submission before signing this Agreement. In that case, the term “You” in this
Agreement will refer to You and the employer collectively. If You change employers in the future and
desire to Submit additional Submissions for the new employer, then You agree to sign a new Agreement
and secure permission from the new employer before Submitting those Submissions.
Licenses.

Copyright License. You grant Microsoft, and those who receive the Submission directly or
indirectly from Microsoft, a perpetual, worldwide, non-exclusive, royalty-free, irrevocable license in the
Submission to reproduce, prepare derivative works of, publicly display, publicly perform, and distribute
the Submission and such derivative works, and to sublicense any or all of the foregoing rights to third
parties.
Patent License. You grant Microsoft, and those who receive the Submission directly or
indirectly from Microsoft, a perpetual, worldwide, non-exclusive, royalty-free, irrevocable license under
Your patent claims that are necessarily infringed by the Submission or the combination of the
Submission with the Project to which it was Submitted to make, have made, use, offer to sell, sell and
import or otherwise dispose of the Submission alone or with the Project.
Other Rights Reserved. Each party reserves all rights not expressly granted in this Agreement.
No additional licenses or rights whatsoever (including, without limitation, any implied licenses) are
granted by implication, exhaustion, estoppel or otherwise.

Representations and Warranties. You represent that You are legally entitled to grant the above
licenses. You represent that each of Your Submissions is entirely Your original work (except as You may
have disclosed under Section 3). You represent that You have secured permission from Your employer to
make the Submission in cases where Your Submission is made in the course of Your work for Your
employer or Your employer has intellectual property rights in Your Submission by contract or applicable
law. If You are signing this Agreement on behalf of Your employer, You represent and warrant that You
have the necessary authority to bind the listed employer to the obligations contained in this Agreement.
You are not expected to provide support for Your Submission, unless You choose to do so. UNLESS
REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING, AND EXCEPT FOR THE WARRANTIES
EXPRESSLY STATED IN SECTIONS 3, 4, AND 6, THE SUBMISSION PROVIDED UNDER THIS AGREEMENT IS
PROVIDED WITHOUT WARRANTY OF ANY KIND, INCLUDING, BUT NOT LIMITED TO, ANY WARRANTY OF
NONINFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE.
Notice to Microsoft. You agree to notify Microsoft in writing of any facts or circumstances of which
You later become aware that would make Your representations in this Agreement inaccurate in any
respect.
Information about Submissions. You agree that contributions to Projects and information about
contributions may be maintained indefinitely and disclosed publicly, including Your name and other
information that You submit with Your Submission.
Governing Law/Jurisdiction. This Agreement is governed by the laws of the State of Washington, and
the parties consent to exclusive jurisdiction and venue in the federal courts sitting in King County,
Washington, unless no federal subject matter jurisdiction exists, in which case the parties consent to
exclusive jurisdiction and venue in the Superior Court of King County, Washington. The parties waive all
defenses of lack of personal jurisdiction and forum non-conveniens.
Entire Agreement/Assignment. This Agreement is the entire agreement between the parties, and
supersedes any and all prior agreements, understandings or communications, written or oral, between
the parties relating to the subject matter hereof. This Agreement may be assigned by Microsoft.

@microsoft-github-policy-service agree company="Microsoft"

These files are being dropped into the root "Finance" Folder. You should create a subfolder in Finance to represent the appropriate Solution such as:
Finance\Supplier Self Service\
For example - see the SAP Procurement structure:

Added a new folder SAP Template under Finance

repo: microsoft/Templates-for-Power-Platform


text:
Portuguese Localization Coordination

For this language there are 233 translated files, with 129 TODO.
Playground
Done: 74, TODO: 11.

[x] sections.json
[x] Big number literals.ts
[x] Const to let.ts
[x] Infer From Usage Changes.ts
[x] Flattened Error Reporting.ts
[x] Nullish Coalescing.ts
[x] Optional Chaining.ts
[x] Assertion Functions.ts
[x] Recursive Type References.ts
[x] Uncalled Function Checks.ts
[x] Checking Unions with Index Signatures.ts
[x] Accessibility Modifiers.js
[x] Export Modules From.ts
[x] Private Class Fields.ts
[x] Type Imports.tsx
[x] Class Constructor Code Flow.ts
[x] JSDoc Deprecated.ts
[x] Logical Operators and Assignment.ts
[x] Nullish Coalescing.ts
[x] Named Tuples.ts
[x] Unknown in Catch.ts
[x] Variadic Tuples.ts
[x] New JSX Support.tsx
[x] See in JSDoc.ts
[x] Intro to Template Literals.ts
[x] Mapped Types with Template Literals.ts
[x] String Manipulation with Template Literals.ts
[x] TypeScript with Deno.ts
[x] TypeScript with Node.js
[x] TypeScript with React.tsx
[x] TypeScript with Web.js
[x] TypeScript with WebGL.js
[x] Function Chaining.ts
[x] Generic Functions.ts
[x] Typing Functions.ts
[x] Errors.ts
[x] Quick Fixes.ts
[x] Code Flow.ts
[x] Functions.ts
[x] Hello World.ts
[x] Objects and Arrays.ts
[x] Async Await.ts
[x] Immutability.ts
[x] Import Export.ts
[x] JSDoc Support.js
[x] Classes 101.ts
[x] Generic Classes.ts
[x] Mixins.ts
[x] This.ts
[x] JavaScript Playgrounds.js
[x] New Compiler Defaults.ts
[x] Automatic Type Acquisition.ts
[x] Fixits.ts
[x] Mobile Support.ts
[x] Sharable URLs.ts
[x] TypeScript Versions.ts
[x] Soundness.ts
[x] Structural Typing.ts
[x] Type Guards.ts
[x] Type Widening and Narrowing.ts
[x] Enums.ts
[x] Nominal Typing.ts
[x] Types vs Interfaces.ts
[x] Conditional Types.ts
[x] Discriminate Types.ts
[x] Indexed Types.ts
[x] Mapped Types.ts
[x] Any.ts
[x] Literals.ts
[x] Union and Intersection Types.ts
[x] Unknown and Never.ts
[x] Built-in Utility Types.ts
[x] Nullable Types.ts
[x] Tuples.ts
[ ] Create Function from Call.ts
[ ] Abstract Class Constructors.ts
[ ] Rest Elements in Tuple Types.ts
[ ] Smarter Type Alias Preservation.ts
[ ] Use Index Accessors for Index Signatures.ts
[ ] No Implicit Class Overrides.ts
[ ] Separate Write vs Read on Properties.ts
[ ] Control Flow Improvements.ts
[ ] Errors for High Confidence Errors.ts
[ ] Exact Optional Properties.ts
[ ] Use unknown for Catch Variables.ts

TSConfig Reference
Done: 119, TODO: 30.

[x] intro.md
[x] Additional_Checks_6176.md
[x] Advanced_Options_6178.md
[x] Basic_Options_6172.md
[x] Command_line_Options_6171.md
[x] Experimental_Options_6177.md
[x] Module_Resolution_Options_6174.md
[x] Project_Files_0.md
[x] Source_Map_Options_6175.md
[x] Strict_Type_Checking_Options_6173.md
[x] Watch_and_Build_Modes_6250.md
[x] allowJs.md
[x] allowSyntheticDefaultImports.md
[x] allowUmdGlobalAccess.md
[x] allowUnreachableCode.md
[x] allowUnusedLabels.md
[x] alwaysStrict.md
[x] assumeChangesOnlyAffectDirectDependencies.md
[x] baseUrl.md
[x] charset.md
[x] checkJs.md
[x] composite.md
[x] declaration.md
[x] declarationDir.md
[x] declarationMap.md
[x] diagnostics.md
[x] disableReferencedProjectLoad.md
[x] disableSizeLimit.md
[x] disableSolutionSearching.md
[x] disableSourceOfProjectReferenceRedirect.md
[x] downlevelIteration.md
[x] emitBOM.md
[x] emitDeclarationOnly.md
[x] emitDecoratorMetadata.md
[x] esModuleInterop.md
[x] exclude.md
[x] experimentalDecorators.md
[x] explainFiles.md
[x] extendedDiagnostics.md
[x] extends.md
[x] fallbackPolling.md
[x] files.md
[x] forceConsistentCasingInFileNames.md
[x] generateCpuProfile.md
[x] importHelpers.md
[x] importsNotUsedAsValues.md
[x] include.md
[x] incremental.md
[x] inlineSourceMap.md
[x] inlineSources.md
[x] isolatedModules.md
[x] jsx.md
[x] jsxFactory.md
[x] jsxFragmentFactory.md
[x] jsxImportSource.md
[x] keyofStringsOnly.md
[x] lib.md
[x] listEmittedFiles.md
[x] listFiles.md
[x] locale.md
[x] mapRoot.md
[x] maxNodeModuleJsDepth.md
[x] module.md
[x] moduleResolution.md
[x] newLine.md
[x] noEmit.md
[x] noEmitHelpers.md
[x] noEmitOnError.md
[x] noErrorTruncation.md
[x] noFallthroughCasesInSwitch.md
[x] noImplicitAny.md
[x] noImplicitReturns.md
[x] noImplicitThis.md
[x] noImplicitUseStrict.md
[x] noLib.md
[x] noPropertyAccessFromIndexSignature.md
[x] noResolve.md
[x] noStrictGenericChecks.md
[x] noUncheckedIndexedAccess.md
[x] noUnusedLocals.md
[x] noUnusedParameters.md
[x] out.md
[x] outDir.md
[x] outFile.md
[x] paths.md
[x] plugins.md
[x] preserveConstEnums.md
[x] preserveSymlinks.md
[x] preserveWatchOutput.md
[x] pretty.md
[x] reactNamespace.md
[x] references.md
[x] removeComments.md
[x] resolveJsonModule.md
[x] rootDir.md
[x] rootDirs.md
[x] skipDefaultLibCheck.md
[x] skipLibCheck.md
[x] sourceMap.md
[x] sourceRoot.md
[x] strict.md
[x] strictBindCallApply.md
[x] strictFunctionTypes.md
[x] strictNullChecks.md
[x] strictPropertyInitialization.md
[x] stripInternal.md
[x] suppressExcessPropertyErrors.md
[x] suppressImplicitAnyIndexErrors.md
[x] target.md
[x] traceResolution.md
[x] tsBuildInfoFile.md
[x] typeAcquisition.md
[x] typeRoots.md
[x] types.md
[x] useDefineForClassFields.md
[x] watchDirectory.md
[x] watchFile.md
[x] compilerOptions.md
[x] watchOptions.md
[ ] Backwards_Compatibility_6253.md
[ ] Compiler_Diagnostics_6251.md
[ ] Completeness_6257.md
[ ] Editor_Support_6249.md
[ ] Emit_6246.md
[ ] Interop_Constraints_6252.md
[ ] JavaScript_Support_6247.md
[ ] Language_and_Environment_6254.md
[ ] Modules_6244.md
[ ] Output_Formatting_6256.md
[ ] Projects_6255.md
[ ] Type_Checking_6248.md
[ ] help.md
[ ] clean.md
[ ] disableFilenameBasedTypeAcquisition.md
[ ] enable.md
[ ] exactOptionalPropertyTypes.md
[ ] excludeDirectories.md
[ ] excludeFiles.md
[ ] force.md
[ ] noImplicitOverride.md
[ ] preserveValueImports.md
[ ] synchronousWatchDirectory.md
[ ] useUnknownInCatchVariables.md
[ ] verbose.md
[ ] exclude.md
[ ] include.md
[ ] Top Level.md
[ ] buildOptions.md
[ ] typeAcquisition.md

Website copy
Done: 8, TODO: 5.

[x] community.ts
[x] documentation.ts
[x] dt.ts
[x] handbook.ts
[x] head-seo.ts
[x] index.ts
[x] nav.ts
[x] playground.ts
[ ] cheatsheets.ts
[ ] en.ts
[ ] footer.ts
[ ] index2.ts
[ ] tsconfig.ts

Documentation
Done: 32, TODO: 83.

[x] Nightly Builds.md
[x] By Example.md
[x] Consumption.md
[x] Deep Dive.md
[x] Do's and Don'ts.md
[x] Introduction.md
[x] Creating DTS files From JS.md
[x] Intro to JS with TS.md
[x] JSDoc Reference.md
[x] Type Checking JavaScript Files.md
[x] Configuring Watch.md
[x] Project References.md
[x] tsconfig.json.md
[x] Declaration Merging.md
[x] Decorators.md
[x] Iterators and Generators.md
[x] JSX.md
[x] Mixins.md
[x] Module Resolution.md
[x] Modules.md
[x] Namespaces and Modules.md
[x] Namespaces.md
[x] Symbols.md
[x] Triple-Slash Directives.md
[x] Type Compatibility.md
[x] Type Inference.md
[x] Utility Types.md
[x] Variable Declarations.md
[x] Babel with TypeScript.md
[x] DOM Manipulation.md
[x] React.md
[x] TypeScript Tooling in 5 minutes.md
[ ] Library Structures.md
[ ] Publishing.md
[ ] Templates.md
[ ] global-modifying-module.d.ts.md
[ ] global-plugin.d.ts.md
[ ] global.d.ts.md
[ ] module-class.d.ts.md
[ ] module-function.d.ts.md
[ ] module-plugin.d.ts.md
[ ] module.d.ts.md
[ ] TS for Functional Programmers.md
[ ] TS for JS Programmers.md
[ ] TS for OOPers.md
[ ] TS for the New Programmer.md
[ ] Basic Types.md
[ ] Classes.md
[ ] Functions.md
[ ] Generics.md
[ ] Interfaces.md
[ ] Literal Types.md
[ ] Unions and Intersections.md
[ ] Basics.md
[ ] Classes.md
[ ] Everyday Types.md
[ ] Modules.md
[ ] More on Functions.md
[ ] Narrowing.md
[ ] Object Types.md
[ ] The Handbook.md
[ ] Type Declarations.md
[ ] Understanding Errors.md
[ ] Conditional Types.md
[ ] Generics.md
[ ] Indexed Access Types.md
[ ] Keyof Type Operator.md
[ ] Mapped Types.md
[ ] Template Literal Types.md
[ ] Typeof Type Operator.md
[ ] _Creating Types from Types.md
[ ] Compiler Options in MSBuild.md
[ ] Compiler Options.md
[ ] Integrating with Build Tools.md
[ ] Advanced Types.md
[ ] Enums.md
[ ] Experimental ESM Support for Node.md
[ ] Overview.md
[ ] TypeScript 1.1.md
[ ] TypeScript 1.3.md
[ ] TypeScript 1.4.md
[ ] TypeScript 1.5.md
[ ] TypeScript 1.6.md
[ ] TypeScript 1.7.md
[ ] TypeScript 1.8.md
[ ] TypeScript 2.0.md
[ ] TypeScript 2.1.md
[ ] TypeScript 2.2.md
[ ] TypeScript 2.3.md
[ ] TypeScript 2.4.md
[ ] TypeScript 2.5.md
[ ] TypeScript 2.6.md
[ ] TypeScript 2.7.md
[ ] TypeScript 2.8.md
[ ] TypeScript 2.9.md
[ ] TypeScript 3.0.md
[ ] TypeScript 3.1.md
[ ] TypeScript 3.2.md
[ ] TypeScript 3.3.md
[ ] TypeScript 3.4.md
[ ] TypeScript 3.5.md
[ ] TypeScript 3.6.md
[ ] TypeScript 3.7.md
[ ] TypeScript 3.8.md
[ ] TypeScript 3.9.md
[ ] TypeScript 4.0.md
[ ] TypeScript 4.1.md
[ ] TypeScript 4.2.md
[ ] TypeScript 4.3.md
[ ] TypeScript 4.4.md
[ ] TypeScript 4.5.md
[ ] ASP.NET Core.md
[ ] Angular.md
[ ] Gulp.md
[ ] Migrating from JavaScript.md

From @khaosdoctor

Olá e seja bem vindo à coordenação da tradução do site para Português do Brasil. A partir de fevereiro de 2021 estamos com nosso repositório de traduções neste site. (Veja a issue original para ter mais informações https://github.com/microsoft/TypeScript-Website/issues/233#issuecomment-760434044)

Para todos os brasileiros que estão perdidos em como adicionar a sua contribuição no site, siga os seguintes passos:
Primeiramente, veja se o arquivo que você está traduzindo já não está sendo traduzido em outra PR, você pode ver essa informação nesta planilha

Anuncie como um comentário neste post, qual serão os arquivos ou o arquivo que você irá traduzir, se possível mencione o # da PR, depois preencha esta planilha para que todos saibamos o que está sendo feito
Crie um fork deste repositório para seu usuário.
Crie um novo branch no seu fork chamado seuusername-ptbr-translation (por exemplo khaosdoctor-ptbr-translation)
Copie os arquivos não completos que serão traduzidos para o português da pasta en para a pasta pt seguindo a mesma estrutura de arquivos
Realize a tradução
Faça um push para seu fork
Crie uma nova Pull Request neste repositório com suas alterações e o título deve ser [PT-BR] <arquivos>, adicione @khaosdoctor e @danilofuchs na PR para que possamos revisar. Atualize a planilha, alterando o status da coluna "Andamento" para "Pull Request" e coloque o link da PR nessa coluna (o atalho é CTRL|CMD + K)
Uma vez aprovada, sua PR estará no ar, meus parabéns 😄
Quando sua PR for aprovada e mesclada, atualize a planilha para que a coluna "Andamento" esteja como "Completo" na linha da sua PR

Veja exemplos de PRs como a #181 (criada pelo @orta para poder demonstrar como criar uma PR) e a #770 que é a primeira PR de tradução oficial.

From @khaosdoctor

Olá e seja bem vindo à coordenação da tradução do site para Português do Brasil. A partir de fevereiro de 2021 estamos com nosso repositório de traduções neste site. (Veja a issue original para ter mais informações https://github.com/microsoft/TypeScript-Website/issues/233#issuecomment-760434044)

Para todos os brasileiros que estão perdidos em como adicionar a sua contribuição no site, siga os seguintes passos:
Primeiramente, veja se o arquivo que você está traduzindo já não está sendo traduzido em outra PR, você pode ver essa informação nesta planilha

Anuncie como um comentário neste post, qual serão os arquivos ou o arquivo que você irá traduzir, se possível mencione o # da PR, depois preencha esta planilha para que todos saibamos o que está sendo feito
Crie um fork deste repositório para seu usuário.
Crie um novo branch no seu fork chamado seuusername-ptbr-translation (por exemplo khaosdoctor-ptbr-translation)
Copie os arquivos não completos que serão traduzidos para o português da pasta en para a pasta pt seguindo a mesma estrutura de arquivos
Realize a tradução
Faça um push para seu fork
Crie uma nova Pull Request neste repositório com suas alterações e o título deve ser [PT-BR] <arquivos>, adicione @khaosdoctor e @danilofuchs na PR para que possamos revisar. Atualize a planilha, alterando o status da coluna "Andamento" para "Pull Request" e coloque o link da PR nessa coluna (o atalho é CTRL|CMD + K)
Uma vez aprovada, sua PR estará no ar, meus parabéns 😄
Quando sua PR for aprovada e mesclada, atualize a planilha para que a coluna "Andamento" esteja como "Completo" na linha da sua PR

Veja exemplos de PRs como a #181 (criada pelo @orta para poder demonstrar como criar uma PR) e a #770 que é a primeira PR de tradução oficial.

Iniciando a tradução do arquivo explainFiles.md

Novos arquivos adicionados à planilha!

Checkpoint de tradução
Com a adição de alguns novos arquivos, caímos de 98% para 75% pois agora temos 85 arquivos não traduzidos. Esta é a nossa lista até agora

Iniciando a tradução do aquivo noPropertyAccessFromIndexSignature.md

Iniciando tradução de Consumption.md

Iniciando tradução de Deep Dive.md

Que bom que esta de volta @khaosdoctor espero que esteja tudo bem.
Iniciando a tradução dos arquivos  By Example.md e Do's and Don'ts.md

Muito obrigado! Devo recomeçar o review de todas as PRs pendentes e revisar o que falta

Iniciando tradução de Introduction.md

Iniciando a tradução de:

Library Structures
Publishing

Iniciando a tradução do arquivo TS for Functional Programmers.md

Iniciando a tradução do arquivo TS for JS Programmers.md

Iniciando a tradução do arquivo TS for the New Programmer.md

Iniciando tradução do arquivo global-modifying-module.d.ts.md

Pessoal, estou de volta aqui para poder continuar com as reviews!

A planilha foi excluída mesmo?

@orta @khaosdoctor how is this going? Can we still pick up files from the To-Do list?

Hey everyone, we can still check the directories and files mentioned at this PR to find files that haven't been translated yet. It will take a little more work than before but it could be done.
If you guys open any PR you can mention me or ask my review, we can get this running again! The merges will take longer though, since the person who was leading the project inside Microsoft no longer works there. But PRs are always welcome! I'll be taking a look at the existant pt-br PRs and looking for not translated files.
I'll try to post a list here at every weekend for you guys to translate them.

I already have an open PR for the getting-started folder at #133
If you could mention the PRs here would be a lot easier for tracking progress of what is translated and what is not.

@luk3skyw4lker if you need any help reach me on LinkedIn and we can think of solutions to coordinate the translation effort together.  The google sheet worked neatly for as long as it was kept updated. We can create another one.

@Perkles sure! I will check if the sheet was somehow backed up when I accessed it or something like that and can get back here. If it wasn't we can surely create another one from scratch, it will be harder but it's completely possible.

@luk3skyw4lker yes if you want, unfortunately I'm a little bit short on time so I won't be able to take part in all the translations and reviews, but we're a bit slow because some of the workflows are offline and I don't have permissions to correct them :(

Fala galera, voltei aqui com a nova planilha pro tracking, já adicionei lá algumas PRs que eu vi/fiz, podem ir atualizando por aqui e eu vou aparecer sexta a noite e sábado de manhã pra dar review nas PRs abertas.
NOVA PLANILHA
Qualquer dúvida vocês podem me contatar no LinkedIn ou email (só entrar no perfil que ambos estão no readme), vou ver se esse final de semana também já abro outras PRs com as traduções @Perkles se puder revisar as minhas quando tiver tempo, agradeço! :)

authors: LeandroLS Perkles gustavofabro jvitormf khaosdoctor luk3skyw4lker orta


text:
Update hybrid esm package.json example

Change fall-back "types" field to point to the .d.cts file so Typescript correctly resolves the CommonJS types
addresses https://github.com/microsoft/TypeScript/issues/54620

Answered why this example is intentional in https://github.com/microsoft/TypeScript/issues/54620

authors: ajwootto andrewbranch

repo: microsoft/TypeScript-Website


text:
Swap function type comments

I'm brand-new to TypeScript, so I'm not sure if this is correct, but it looked to me like these two comments were supposed to be swapped.

Agree! Thanks!

authors: jaimemarijke orta


text:
TS 3.5 new error when using keyof with assignment to copy property

TypeScript Version:  3.4.0-dev.201xxxxx

Search Terms:

keyof
property

Code
export interface I {
    x: string;
    y: number;
}

function copy(from: I, to: I, key: keyof I) {
    const value = from[key];
    if (typeof value === 'string') {
        to[key] = value
    }
}

Expected behavior:
This compiles under TS 3.4.5 without any errors
Actual behavior:
In TS 3.5, this is a compile error:
Type 'string' is not assignable to type 'string & number'.
  Type 'string' is not assignable to type 'number'.

This is a reasonable error IMO, the change should just be noted somewhere (an issue may already exist but I wasn't sure which keywords to search for). We saw this in the VS Code codebase
Playground Link:
https://www.typescriptlang.org/play/#src=export interface I {
    x%3A string%3B
    y%3A number%3B
}

function copy(from%3A I%2C to%3A I%2C key%3A keyof I) {
    const value %3D from[key]%3B
    if (typeof value %3D%3D%3D 'string') {
        to[key] %3D value
    }
}
Related Issues:

#31380

The PR introducing the change was this one #30769

authors: jack-williams mjbvz

repo: microsoft/TypeScript


text:
Union types aren't always narrowed properly after predicate functions

TypeScript Version:  3.8.0-dev.20191122

Search Terms:
union types, narrowing, guarding
Code
// Imagine redux here. Redux reducers get actions from various places. They have a vague type
type Action = {
  type: any
}

// Our app has 2 actions
type ActionA = {
  type: 'a'
  payload: () => void
}

type ActionB = {
  type: 'b'
  payload: string
}

// This type is a union of all of em. They have distinct types, which can
// be used to discriminate them
type AllOurActions = ActionA | ActionB

// This function takes any action, and determines if it happens to
// be one of ours. If so, it narrows the action's type
declare function isActionOneOfOurs(action: Action): action is AllOurActions

// This is how you could narrow our action type to a specific action type
declare const wereSureAlready: AllOurActions
// This guard usually works
if (wereSureAlready.type === 'a') {
  // Since the `type` property is 'a', we know the payload is a function
  // since 'b' actions have a string payload
  wereSureAlready.payload()
}

// We got this action in our reducer.
// It could be from anywhere(e.g.redux dev tools or a third party lib)
declare const someGivenAction: Action

// If this is true, we know the action is one of ours
if (isActionOneOfOurs(someGivenAction)) {
  // can be narrowed by switch
  switch (someGivenAction.type) {
    case 'a': someGivenAction.payload()
  }
  // can't with other stuff?
  if (someGivenAction.type === 'a') {
    // Why doesn't this work if someGivenAction was narrow by a predicate
    // function.
    someGivenAction.payload()
  }

  // it works if you rebind it
  const worksIfYouRebindIt = someGivenAction
  if (worksIfYouRebindIt.type === 'a') {
    // Why doesn't this work if someGivenAction was narrow by a predicate
    // function. it works if you cast it
    worksIfYouRebindIt.payload()
  }
}

Expected behavior:
Action type properly narrowed by the predicate function and an if statement
Actual behavior:
Action type not narrowed unless you rebind it prior to narrowing or a switch statement is used
Playground Link:
http://www.typescriptlang.org/play/?ssl=1&ssc=1&pln=58&pc=2#code/PTAEEkFsEMHMEsB2BTUAnZATArgD1ABbIYB0oASlnulQMbEDOosyALqNLa-APaJMAzND0igAbtDS9sTAA4AbTsgZkAKkQCehaGNTRxcbKlYbZyAFAmzoAIJdeiUAF5QAb3OhQV5AC4OiDXMAX3NzEFAAeWw0DllZbSYAJg57PgZLU1Q7bj4bZzcPL0y-AHJoEsLZaA15HmhMPwAKAEpnAD5xHnhMYNDvW1TEACF8909vUoAjCs8qmrqG0AZWKURYXrCwdXgmfp2OUGxEB1AeAQ55eVPz5Eg1TW1dUEwd7kQuIrMGABpQAHcCPBaARQLRoI5NqBJqgZFgvDxnjtaFJIEhoKxjERIBlrDZLlE0NkHEwXETcqAAD4DHLDULhbaCI6DLzQADWyn8Wk4NN+4MwzzYxFRKCY8HO8HYBGgcWQ-HhkOhpxQ11O0RUEHODB4vwloEQkmEf12RBSNJKu0y5kwyFoigwoAETJpoB2ZMQERQEQEBIYjW5Dj8buafn9fBdTDx8gJbvSkIZ4cIPD+oA0PGwoLT8n5+rQhtVMVDjn6rAR+gYZloYqBppO3itNrtqFoaXYf2IyAAytFkHiMPUNIH8dEY3HAUxYNhJPyZJPLlo-jw0Kz0mLQI02xguxhe8h+yR+k5D6AyiVWmNQOEO0h6F4TQADbx30CyYRmNAmBMn35t0CsxBJ29UDmWp6gTfRHXeGlCnCBhr1QEpphrNJHj0JYViQWBn2qECek8DdO27Hc92AhYWg2cIAHVUFgHh2FYMckMcJB8xoHB6DQEhIXAdhm2wLMoVQIQRE5AF20aZASFgEgMBwfBrTEeEeHkJhFwOej4DQfkqnfLR5HgSZmnrW1JCbFslhEZAAHF4F0RA3UDQY6TAcBznU0VdjQIxv1QP8APovRmX2PhUDOfMV3ORpXUGD1kC9H1Gi1SArJs2UgzPaCwDBRxFRzQ04UmLQGD+CVgUKIqSpBBKLOs2y3X3TJ0s8TwwQYeDyj8RLktqwYSBI+oyM8EJPHCLKSlbCUQVoogYmWbABAEAB+QpVyqpKatSnqDyPE9GqayiCC0TAeGURAxtvfYFyXF1NWqlK7OZP5oCYXKAIKg4XywIF0QsJqLzACCetAQpPE69b7ppXrsNIwzBtCYawF1S7l2ulM0xoSYkH5CVCmbfhW0XZcXIATTTSgMcQTBuPyUG7rdZaIqRhhidJ5Bycp1h6usQ8XB2gpfv2w7joYU66IYpGUZp7rnUe56DVerlnxkr6MWBv6HSdBwyERgnRXOVN0xa9hsd+xnmewMnMe4yH5n6mHQBCIIgA
Related Issues:
Couldn't find anything directly related

Duplicate of https://github.com/microsoft/TypeScript/issues/13962

This shows that the binding can be narrowed despite not being a union, as long as its narrowed with a switch statement: http://www.typescriptlang.org/play/?ssl=1&ssc=1&pln=27&pc=2#code/C4TwDgpgBAggxsAlgewHZQLxQN4CgpSiQBcUAhqiLgL665HTxJoyY76HgSkDkZPHMGRAAbZGQAmpABQBKTAD4oAN2SIJNOg1gIUqAEJs8BBrwBGAgkNHipUAM7AATolQBzTfS6wRIgPIArk5MevZsISxQAD46zAZ0EhBwImRO0ABmAai6aFCI9hGofqgQfumBTvbSZDmopIWypDVxeWEwvhWF9glJKWlQcGiODsgAthAA4ojKEKiF9bV0APRLUACS6YQAFvmthE4BEAA0UADu0ADWqMin29DNento0MibyEHdiJvS+YXFpeUPtJ7GNJtNZg15MYoCsBhQoGZoKhUk4bhAJAiQA5TohgHAthx7Di8VsoMDQVMZnNagA6BhQjgEOBkezQPg8Ugg8aUiG06xiSRyDi0ahAA
type Action = {
  type: any
}

type ActionA = {
  type: 'a'
  payload: () => void
}

type ActionB = {
  type: 'b'
  payload: string
}

type AllOurActions = ActionA | ActionB

declare function isActionOneOfOurs(action: Action): action is AllOurActions

declare const someGivenAction: Action

// If this is true, we know the action is one of ours
if (isActionOneOfOurs(someGivenAction)) {
  // can be narrowed by switch
  switch (someGivenAction.type) {
    case 'a': someGivenAction.payload()
  }
}

Duplicate  #30557

Narrowing by discriminant only applies when the declared type of the identifier is a union type

What makes the switch statement different that narrowing works for that but not for if?  I couldn't find anything in the linked issues that explained this discrepancy.

authors: RyanCavanaugh dplumlee fatcerberus nmain oatkiller


text:
TSX data-* props issue with Stricter Assignability Checks to Unions with Index Signatures

Seems like the new Stricter Assignability Checks to Unions with Index Signatures in 3.8 makes it impossible to have data-* props passed to React components when their props type is based on a union.
Pardon the contrived example below (I tried to reduce as much as possible for clarity sake). For a real case most material UI components props types are using unions and therefor fail the same test.
TypeScript Version:  3.8-Beta

Search Terms:
data
Stricter Assignability Checks to Unions with Index Signatures
Expected behavior:
The data- props should be accepted all the time (3.7 behaviour)
Actual behavior:
With 3.8 any extra data-* will be rejected if the props type is based on a union.

Related Issues:
In another repo, but may be this https://github.com/mui-org/material-ui/issues/19536 ?
Code
import React, { ReactElement} from "react";

declare function NotHappy(props: ({ fixed?: boolean } | { value?: number })): ReactElement;
declare function Happy(props: { fixed?: boolean, value?: number }): ReactElement;

const RootNotHappy = () => (<NotHappy data-testid="my-test-id" />)
const RootHappy = () => (<Happy data-testid="my-test-id" />)

Compiler Options
{
  "compilerOptions": {
    "noImplicitAny": true,
    "strictNullChecks": true,
    "strictFunctionTypes": true,
    "strictPropertyInitialization": true,
    "strictBindCallApply": true,
    "noImplicitThis": true,
    "noImplicitReturns": true,
    "useDefineForClassFields": false,
    "alwaysStrict": true,
    "allowUnreachableCode": false,
    "allowUnusedLabels": false,
    "downlevelIteration": false,
    "noEmitHelpers": false,
    "noLib": false,
    "noStrictGenericChecks": false,
    "noUnusedLocals": false,
    "noUnusedParameters": false,
    "esModuleInterop": true,
    "preserveConstEnums": false,
    "removeComments": false,
    "skipLibCheck": false,
    "checkJs": false,
    "allowJs": false,
    "declaration": true,
    "experimentalDecorators": false,
    "emitDecoratorMetadata": false,
    "target": "Latest",
    "jsx": "Preserve",
    "module": "ESNext"
  }
}

Playground Link: Provided

As a short-term workaround:
<NotHappy data-testid={"my-test-id" as never} />

But I agree, this looks like it should work to me.

I've heard two reports of this so far, might be worth including in a 3.8 patch also

@orta it would be great. If the fix it is not making it in a patch release for the 3.8 we will have to skip the whole minor. I can imagine that we are not the only ones in this case. This is not uncommon for people to use data-* in React, especially peeps using Cypress where it is even considered a best practice.

I've heard two reports of this so far, might be worth including in a 3.8 patch also

This affects Elastic UI as well; similar to Material UI we have a number of components which are unions. If this break is not fixed in 3.8 it not only affects our Elastic&Material UI projects directly but also blocks any downstream consumers from using TypeScript 3.8 + these component libraries.

authors: Retsam chandlerprall jraoult orta


text:
Support TS server returning custom schemes

We have a TS server that can return zip paths (zip:///path/to/module.zip/package.json). We also have a VSCode extension that can handle such paths using a zip: protocol handler.
Using "Go to definition" unfortunately doesn't work because VSCode hardcodes the list of valid protocols, so the zip: protocol is lost as soon as the service client reworks the path.
Looking at the blame history, it looks like the hardcode occurred organically, with the first one being a one-of check, later followed by another one-of workaround. I believe at this time VSCode didn't support custom schemes (at least not visible for extensions), so this made sense. Now, I think it should simply forward all schemes it recognizes. Would you accept a PR to this effect?
Related: https://github.com/microsoft/vscode/issues/59650
Cc: @mjbvz @cspotcode

Moving upstream as this will require coordination between TS Server and VS Code
Historically, TS server crashes if you send it a document with a weird scheme that it can't handle so we need to make sure the plugin that handles zip schema is active before sending those files over from VS Code

@mjbvz isn't the "vscode -> TS" direction the issue in https://github.com/microsoft/vscode/issues/59650, whereas "TS -> vscode" is this one?

VS Code can't send over zip: files until the TS server tells us it understands them and won't crash (i.e. your plugin is running)

But why would VSCode send a zip: path to TS? This issue is about VSCode opening the buffer from the zip: path sent by the TS server.

Won’t that file reference other files that are also under the zip path?

In our use-case, the zip paths always originate from the TS server, not VSCode.

User opens /project/index.ts in VSCode.
Code refers to a third-party dependency, for example: import {each} from 'lodash';
Our TSServer with our plugin is able to resolve the dependency to a zip path, and to read the contents of the zip archive.
When the user hits "go to definition," the server sends the zip path to VSCode.  VSCode attempts to open the zip path.  We need some way for VSCode to read zip archives, perhaps via a zip:// protocol handler.
VSCode asks tsserver for semantic diagnostics, passing the same zip path to tsserver.  It recognizes the zip path, because it originated from tsserver.

In the above timeline, VSCode is sending zip paths to TSServer, but only after those zip paths originated from TSServer, so it all works.
I'm still not sure what format these paths should be in.  Today, yarn does zip paths kinda like this: /project/.yarn/cache/lodash.zip/node_modules/lodash/index.d.ts
But if we want to use a zip:// protocol handler in VSCode, then it'll need to see paths that are actually URIs and look like this: zip:///project/.yarn/cache/lodash.zip/node_modules/lodash/index.d.ts
We can do this translation within our custom TSServer implementation if necessary; we've already prototyped it.  But we need VSCode to allow us to send it URIs, however is the best way to do that.

Won’t that file reference other files that are also under the zip path?

Yep, but if I understand correctly I think sending schemed references to VSCode is a better fit for the thread over at https://github.com/microsoft/vscode/issues/59650 - this one is purely to receive them.
Basically, for https://github.com/microsoft/vscode/issues/59650 to be fixed TS will have to support custom schemes, but for the issue described in this thread to be fixed, changes are only needed on the VSCode side.

Thanks for the details. A few potential options:

Add way for TS tell us which schemes to sync on start. I'd prefer this approach.

Trust all files that come from TS server. This gets complicated as we need to dynamically enable/disable language features on the VS Code side. I'm also not sure off the top of my head how to handle server restarts (with the plugin being disabled after the restart)

Why would language features have to be disabled or enabled on the TS side? I'm probably missing a piece, but for example in the case I mentioned the Zip extension provides the ambient scheme through the FileSystemProvider API, so it doesn't need to be enabled at runtime.

Ping @mjbvz? From my outsider's perspective, the following addition (the highlighted part, added here) would completely solve this issue - am I missing something?

Ping? Is this issue still "Needs more info"?

VS Code will have to maintain this fix and I'm concerned about it—as small a code change as it may be—causing problems down the road.
You need to prove not just that the change fixes for the feature request, but that it won't cause additional problems. Basically, apply the fix and then try breaking things. Go through a thorough test pass of all different states the editor could be in: having the extension enabled/disabled, files opened in different states, using different TS server versions, and so on. Test if as if you were the person who will have to maintain the code going forward and deal with every bug report related to JS/TS that comes in
Report the scenarios you tested, what works and what doesn't, and then we can go from there

Please find below details for a matrix of scenarios that should hopefully add to the confidence levels of this proposed change.
To run the procedures:

git clone --depth 1 git@github.com:elmpp/berry.git -b vscode-case-study yarn2-36943 && cd yarn2-36943
(cd packages/vscode-zipfs && yarn build || true  >& /dev/null && yarn vsce package)
./scripts/vscode-zip-test-procedure.sh ./vscode-case-study // vscode will build the first time so likely take few mins
follow the steps

Matrix:
Typescript version: 2.7.1, 2.9, 3.5.1, 3.8, 3.8-pnpify
ZipFS extension: enabled, disabled
Package Manager: npm, yarn2
Package Arrangement: pnp, node_modules
Editor states (with '.ts'): default view, hover/cmd+click import package reference, hover/cmd+click/cmd+doubleclick import symbol reference,
Editor states (with '.d.ts'): default view, hover on symbol
Note all these scenarios are with the proposed change.

Thanks.
Can you also test the case where I have a file opened that relies on your plugin, but I then reload VS Code so that the file is loaded again but with the plugin in a disabled or crashed ? I want to make sure we handle the case when TS server is sent a schema that it doesn't understand

@mjbvz Extra test case added for disabled extension and reload

authors: arcanis cspotcode elmpp mjbvz


text:
Distribute property type union members to create union of object types

TypeScript Version:  v3.9.0-dev.20200222

Search Terms: union type object property
Code
type Test =
  | { b: [false, "a"] }
  | { b: [true, "b"] }

declare const b2: boolean;
const a: Test = { b: b2 ? [b2, "b"] : [b2, "a"] }

Expected behavior:
No error. I'm not exactly sure if this is a bug or feature request but, essentially, it'd be nice if TS could recognize that: { b: [true, "b"] | [false, "a"]; } is identical to { b: [true, "b"] } | { b: [false, "a"]; }
Actual behavior:
Type '{ b: [true, "b"] | [false, "a"]; }' is not assignable to type 'Test'.
  Type '{ b: [true, "b"] | [false, "a"]; }' is not assignable to type '{ b: [true, "b"]; }'.
    Types of property 'b' are incompatible.
      Type '[true, "b"] | [false, "a"]' is not assignable to type '[true, "b"]'.
        Type '[false, "a"]' is not assignable to type '[true, "b"]'.
          Type 'false' is not assignable to type 'true'.

Playground Link: Playground Link

We have some logic that @rbuckton added that handles some of these cases - maybe it's not exactly detecting the narrowing correctly? I would have expected this to work

We only currently handle this for cases where the source type is a discriminated union, which isn't the case here.

authors: RyanCavanaugh ethanresnick rbuckton


text:
Const enums with mixed types not correctly having their type deduced

TypeScript Version:  3.9.0-dev.20200327
Search Terms: const enum enums mixed types
Code
interface IDBTarget {
  result: IDBDatabase;
}

const enum ObjectStoreNames {
  OBJECT_STORE_KEY_PATH = "object-store-key-path",
  VERSION = 1
}

const request = indexedDB.open("list-of-items", ObjectStoreNames.VERSION);

request.onupgradeneeded = evnt => {
  if (evnt.target === null) {
    return;
  }

  const db = (evnt.target as unknown as IDBTarget).result;

  db.createObjectStore("storage-of-objects", {
    keyPath: ObjectStoreNames.OBJECT_STORE_KEY_PATH
  });
}

Expected behavior: The TypeScript compiler deduces that OBJECT_STORE_KEY_PATH is a string at runtime and thus lets it be used as value for this property.
Actual behavior: The TypeScript compiler complains that ObjectStoreNames cannot be assigned to string.
Playground Link: https://www.typescriptlang.org/play/?ts=3.9.0-dev.20200327#code/JYOwLgpgTgZghgYwgAgJIBEBCAVOUDmEYyA3gLABQyyUEAzgK4A2YAXGlunGHAEZx0IAbkoBfSpQQB7EHWIQQDALbIA8rwBWEBGADKYKbQBycJfVKVqqzACkAogGFsAfV3ZVAJTvOA0nYCazgAKAILYABLIALzIAERSmtpgALRyhhDJANYQAJ7JAA7cABaxADSWyABqdh66qKpG0cgAjGISFNKyxLQAjgz0xDGgACYQAB4Qw1gAdFL5CgAUsUzAcslSMMnAkEp0ZWqJOvrpJmZ009W19UYAlCIUlL39crOK+fhQcKMgEJOTTRAAG7gaIAPgsVGQwBgyAWQPA0x4BCI0SiMUUTCYNwh1GotDADCgIHu1HED0hnTkyGGvCacOBYEReEIxAEyAYIEyICkAHcQMg2RgcMyiDdprRGCx7hUadMELRuBB1FojgZaEs0p9COtNgkVWA9qUcbjsjkgsV2MqksdjKZ6NNrPYnK53F5fAFgmFwhVRHcxEA
Related Issues:

This is the intended behavior - TS assumes that you want to maintain flexibility on the underlying values here (otherwise you could just have used a regular object). Use as const on the value if this is not your intent.

authors: Newbytee RyanCavanaugh


text:
Function generics losing type information (A extends B)

TypeScript Version:  3.9.2

Search Terms: function generics losing type information
Code
type A = {
    value: string
}

type B = {
    [key: string]: Partial<A>
}

type C<T> = {
    readonly [K in keyof T]: string
}

function test<T extends B>(input: T): C<T> {
    return {} as any
}

const output1 = test({
    hello: {
        value: '', // ok
        world: ''  // this should not be allowed (expected 2322)
    }
})

const output2 = test({
    hello: {
        value: '',  // ok
        world: ''   // this should not be allowed (expected 2322)
    } as Partial<A> // this does nothing to enfoce the value type
})

Expected behavior:
The world property in the above code should not be allowed because it does not exist on type A. This only appears to become an issue when using T extends B in the function signature
Actual behavior:
The world property in the above code is allowed
Note The use of T extends B here is used to map the keys in input T to the return type C<T>
Playground Link:
This example highlights the issue

The more tiny example [playground]:
interface Input {
    hello: {
        value: string;
    };
};

const test = <T extends Input>(input: T): T => input;

const testInput: Input = {
    hello: {
        value: '', // OK
        world: '',  // Is not allowed - OK
    },
    field: 42, // Is not allowed - OK
};

const result1 = test(testInput);

const result2 = test({
    hello: {
        value: '', // OK
        world: ''  // Allowed - not OK
    },
    field: 42, // Allowed - not OK
})

As I see, it was discussed here: https://stackoverflow.com/questions/44645560/typescript-strict-class-interface
Link to the issue from one of the answers: https://github.com/Microsoft/TypeScript/issues/12936

If you add a required property to the partial type, the expected 2322 error is reported correctly for unknown properties until you add the the required property
type A = {
    value: string
}

type B = {
    [key: string]: Partial<A> & { id: string }
}

function test<T extends B>(input: T): any {
    return {}
}

const output1 = test({
    hello: {
        id: '',
        value: '',
        world: '' // this should not be allowed (expected 2322 error)
    }
})

const output2 = test({
    hello: {
        value: '',
        world: '' // this correctly reports the expected 2322 error, until the `id` property is added
    }
})

Playground Link

This is the intended behavior; in general inference is always allowed to choose a more specific type for a type parameter given a candidate of that type. You can convince inference to do other things by using intersections and such, but this isn't a bug.

This is the intended behavior; in general inference is always allowed to choose a more specific type for a type parameter given a candidate of that type. You can convince inference to do other things by using intersections and such, but this isn't a bug.

That is understandable @RyanCavanaugh but I have had no luck getting this to work correctly. For example, the following code correctly reports a 2322 error if an unknown Values property is added to input, unfortunately output then obviously loses code hints for the mapped property keys
I have not been able to get this working with intersections either
type Values = { a: string, b: string, c: string }
type Input = { [key: string]: Partial<Values> }
type Output<T> = { [K in keyof T]: string }

function test<T extends Input>(input: T): Output<T> {
    return {/* placeholder */} as any
}

const input: Input = {
    hello: { a: "", b: "" }
}

test(input).hello // unknown property

It feels like we need a way to tell TSC that T does not extend Input but is actually an instance of Input
function test<T is Input>(input: T): Output<T> { ... }
function test<T typeof Input>(input: T): Output<T> { ... }
function test<T instanceof Input>(input: T): Output<T> { ... }

Do you have any further thoughts on, or solutions for, this?

@RyanCavanaugh, the following code appears to be the solution
type Values = {
    a: string
    b: string
}

type Input<P extends keyof any> = {
    [K in P]: Partial<Values>
}

type Output<P extends keyof any> = {
    [K in P]: string
}

function test<P extends keyof any>(input: Input<P>): Output<P> {
    return {} as any
}

const output = test({
    one: {},
    two: {
        a: '',
        z: '' // error
    }
})

output.one
output.two
output.three // error

I will close this issue. Thank you for your time


text:
Feature Request: Collapsible chained methods.

Search Terms
Collapsible
Chained
I was told to file a feature request upstream
This was originally an issue on the vscode github.

Suggestion
Chained methods should be collapsible, just like objects and arrays that span multiple lines.

Use Cases
Why This Is a Helpful Feature
When a lot of chained methods are written in a file, it can be really annoying because currently they aren't chainable. For example, with a library that I'm making which is heavily based on chained methods, they can take up a lot of space. In Visual Studio 2019, I can collapse chained methods, but in VSCode, I can't.
My Many Chained Methods
new Scene()
    .setBackgroundColor("skyBlue")
    .add(0, 5, new Rectangle(0, 250, 600, 350)
        .fill("yellow")
    )
    .add(0, 5, new Group(-600, 0)
        .fill("red")
        .add(new Rectangle(100, 100, 300, 200))
        .add(new Rectangle(400, 200, 100, 100))
        .add(wheel(400, 300))
        .add(wheel(200, 300))
        .animate(0, 5, new Animation({
            x: -600
        }, {
            x: 600
        }))
    ))

Examples
Builtin Classes like Map and Set.
Expanded.
var m = new Map()
    .set("apple", "red")
    .set("banana", "yellow")
    .set("grapes", "purple")

Collapsed should be something like this.
> var m = new Map()...
  )

Promises
Expanded
fsPromises.unlink("somePath")
    .then(() => {
        //Do something
    })
    .catch(err => {
        //Handle error
    })

Collapsed should be something like this.
> fsPromises.unlink("somePath")...
  )

Checklist
My suggestion meets these guidelines:

[x] This wouldn't be a breaking change in existing TypeScript/JavaScript code
[x] This wouldn't change the runtime behavior of existing JavaScript code
[x] This could be implemented without emitting different JS based on the types of the expressions
[x] This isn't a runtime feature (e.g. library functionality, non-ECMAScript syntax with JavaScript output, etc.)
[x] This feature would agree with the rest of TypeScript's Design Goals.

Thoughts @jessetrinity? I looked through existing issues, and while there are a lot of these, it doesn't look like anyone has requested the chaining behavior. Also wonder what other languages do here.

It seems about as reasonable as the outlining for call expressions that was added recently. I'm not aware of C# doing this in Visual Studio though. I'm looking at some chained calls in one of our projects and don't see it there anyway. Obviously we wouldn't have it for .ts/.js.
@ChocolateLoverRaj would you be able to provide the example that does this in VS?

@jessetrinity I'm not sure what you mean about C#. Just to clarify, both of the examples are in JavaScript. I'm pretty sure that both of the examples are foldable in visual studio 2019.

@ChocolateLoverRaj VSCode and VS should have the same collapsible regions since the feature is powered by TypeScript. There might be a few places where the editor add some addition functionality, but AFAIK VS does not do anything like that for .ts files.

The collapsible regions you in this example are a consequence of #39109. The outlines are coming from the multiline call expression, not from the call chaining, and they show up in VS and VSCode. The second example with no multiline call expressions does not produce outlining spans in VS or VSCode:

I was only referring to C# as an example of another place where VS might be doing this.

@jessetrinity  I see how the second example has the same effect on Vscode and Vs. I saw the top image you sent,  and I see how there is a - icon where () spam multiple lines. Is this the same for vscode too? I don't remember being able to collapse any part of the top example is vscode.

@ChocolateLoverRaj I think this is a 4.0 feature so you would see it in VSCode if you had the nightly extension. Now that I think about it it would be really surprising if you saw this in VS...

So how do I update my typescript to be able to collapse parts of the code like the first image you sent? I don't have VS installed anymore because I switched to Vscode.
Also, would it still be possible to add the feature that can collapse all chained methods?

@ChocolateLoverRaj for VSCode follow the instructions here.

To the original issue: I think it seems reasonable. I am interested to know if others would like to see this.

I think this is a 4.0 feature so you would see it in VSCode if you had the nightly extension.

@jessetrinity You said that the feature is in typescript 4.0. If I just wait for that version to be a regular release, around when will that update be? I don't know how the features and versioning works for typescript. Do new versions get released in a certain time interval, or do they get released when there are big changes?

We release iteration plans to give an idea of when to expect new features. New releases come out around every 3 months. Our current iteration plan for 4.0 has a stable release planned for August 18th. We also have pre-releases like the beta or RC that you can try in the meantime!

To the original issue: I think it seems reasonable. I am interested to know if others would like to see this.

@jessetrinity So how will we know if others will like to see this? So far only three people (@jessetrinity, @DanielRosenwasser, @jessetrinity) have talked about this issue.

I would love to see this as well.

authors: ChocolateLoverRaj DanielRosenwasser HeIIow2 jessetrinity


text:
Type 'IPropertyValue' is not assignable to type 'IPropertyValue'.

interface IObjectWithId {
  id: number
}
interface IDerived extends IObjectWithId {
  name: string
}
interface IPropertyValue<T extends IObjectWithId> {
  formatter: (row: T) => void
}

const notassignable: IPropertyValue<IObjectWithId> = {} as IPropertyValue<IDerived>

Output
"use strict";
const notassignable = {};

Compiler Options
{
  "compilerOptions": {
    "noImplicitAny": true,
    "strictNullChecks": true,
    "strictFunctionTypes": true,
    "strictPropertyInitialization": true,
    "strictBindCallApply": true,
    "noImplicitThis": true,
    "noImplicitReturns": true,
    "alwaysStrict": true,
    "esModuleInterop": true,
    "declaration": true,
    "experimentalDecorators": true,
    "emitDecoratorMetadata": true,
    "moduleResolution": 2,
    "target": "ES2017",
    "jsx": "React",
    "module": "ESNext"
  }
}

Playground Link: Provided
This fails to compile with:
const notassignable: IPropertyValue
Type 'IPropertyValue' is not assignable to type 'IPropertyValue'.
Property 'name' is missing in type 'IObjectWithId' but required in type 'IDerived'.(2322)
input.tsx(5, 3): 'name' is declared here.
Interestingly, if I change the formatter property of the IPropertyValue interface to simply be a type of T, then it compiles.
It seems having formatter as a type of a function that takes a Parameter of T causes it to fail.

This error is preventing a potential crash:
interface IObjectWithId {
  id: number
}
interface IDerived extends IObjectWithId {
  name: string
}
interface IPropertyValue<T extends IObjectWithId> {
  formatter: (row: T) => void
}

const p: IPropertyValue<IDerived> = {
    formatter(m) {
        console.log(m.name.toLowerCase());
    }
}

const notassignable: IPropertyValue<IObjectWithId> = {} as IPropertyValue<IDerived>;
// Crashes
notassignable.formatter({ id: 10 });

See https://en.wikipedia.org/wiki/Covariance_and_contravariance_(computer_science) for why parameter position vs property position matters

Thank you for your quick response and simple explanation.

authors: DavidSnipp RyanCavanaugh


text:
Indexed Access Types don't play well with overloads

Bug Report
For type-safety, I often use Indexed Access Types in my decorators. But if the method being decorated has overloads, the IAT seems to resolve to the overload definition above the decorator, rather than the actual implementation below the decorator. I also tried "indexing" into the IAT to see if I could pick a specific overload, but that doesn't seem possible.
Because the IAT doesn't resolve to the implementation, it can lead to bugs where things look type-safe but will fail at runtime -- see my code below.
🔎 Search Terms
Indexed Access Types, overloads
🕗 Version & Regression Information

This is the behavior in every version I tried

⏯ Playground Link
Playground link
💻 Code
function gate<T extends (...arg: any) => any>(resolver?: (...args: Parameters<T>) => string) {
	return (target: any, key: string, descriptor: PropertyDescriptor) => {
    descriptor.value = function (this: any, ...args: any[]) {
      console.log(resolver?.(...(args as Parameters<T>)));
    }
	};
}

class Foo {
  bar(a?: string, b?: string): void;
  bar(a: number, b: number): void; // <- the Foo['bar'] seems to use this overload
  @gate<Foo['bar']>((a, b) => a.toString() + b.toString())
  bar(a: string | number | boolean | undefined, b: string | number | boolean | undefined): void {
  }
}

const foo = new Foo();
foo.bar('a', 'b');
foo.bar(); // <- [ERR]: Cannot read properties of undefined (reading 'toString')

Output
"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
function gate(resolver) {
    return (target, key, descriptor) => {
        descriptor.value = function (...args) {
            console.log(resolver === null || resolver === void 0 ? void 0 : resolver(...args));
        };
    };
}
class Foo {
    bar(a, b) {
    }
}
__decorate([
    gate((a, b) => a.toString() + b.toString()),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", [Object, Object]),
    __metadata("design:returntype", void 0)
], Foo.prototype, "bar", null);
const foo = new Foo();
foo.bar('a', 'b');
foo.bar(); // <- [ERR]: Cannot read properties of undefined (reading 'toString')

Compiler Options
{
  "compilerOptions": {
    "strict": true,
    "noImplicitAny": true,
    "strictNullChecks": true,
    "strictFunctionTypes": true,
    "strictPropertyInitialization": true,
    "strictBindCallApply": true,
    "noImplicitThis": true,
    "noImplicitReturns": true,
    "alwaysStrict": true,
    "esModuleInterop": true,
    "declaration": true,
    "experimentalDecorators": true,
    "emitDecoratorMetadata": true,
    "target": "ES2017",
    "jsx": "react",
    "module": "ESNext",
    "moduleResolution": "node"
  }
}

🙁 Actual behavior
No type error, but runtime error
🙂 Expected behavior
Type error

The implementation signature for a set of overloads is always invisible from outside the function, by design.  It’s only used for type checking the implementation itself.

// <- the Foo['bar'] seems to use this overload

This is not correct, and the playground demonstrates this:

The issue is not with the indexer, but the usage of Parameters<T>. This is a conditional type using inference, and inference in conditional types does not support overloads. The documentation explicitly mentions that inference is made from the last signature.

I guess it is inferencing from the last public signature -- not the last one. Is there any way to get this to work?

No; you can't access the implementation signature from outside the function.

Add another signature, if you want another signature.

authors: MartinJohns eamodio fatcerberus


text:
missing DataTransferItem.getAsFileSystemHandle

https://github.com/microsoft/TypeScript/blob/aa920c00f21e8a378e0b282401786b00d6310803/lib/lib.dom.d.ts#L4127-L4146
/** One drag data item. During a drag operation, each drag event has a dataTransfer property which contains a list of drag data items. Each item in the list is a DataTransferItem object. */
interface DataTransferItem {
    /** Returns the drag data item kind, one of: "string", "file". */
    readonly kind: string;
    /** Returns the drag data item type string. */
    readonly type: string;
    /** Returns a File object, if the drag data item kind is File. */
    getAsFile(): File | null;
    /** Invokes the callback with the string data as the argument, if the drag data item kind is text. */
    getAsString(callback: FunctionStringCallback | null): void;
+   /** @deprecated Non standard, use getAsFileSystemHandle() instead */
    webkitGetAsEntry(): FileSystemEntry | null;
+   /** The getAsFileSystemHandle() method of the DataTransferItem interface returns a FileSystemFileHandle if the dragged item is a file, or a FileSystemDirectoryHandle if the dragged item is a directory. */
+   getAsFileSystemHandle(): Promise<FileSystemFileHandle|FileSystemDirectoryHandle>;
}

This isn't sufficiently-supported yet

Is there a published rule for what constitutes "sufficiently supported?"

For example, FileSystemDirectoryHandle.values has broader support, but is still missing from the DOM library type definition, along with other methods of that object and related objects in this API.
Knowing what the rule is would help prevent myself & others from wasting time on suggesting improvements that won't be accepted due to insufficient browser support, even if they do bring the TypeScript definition better in line with the standards.

according to https://github.com/microsoft/TypeScript/issues/48001#issuecomment-1049204267
it must be two different engines (eg: Blink and Firefox) or Firefox and webkit (safari)
chrome and brave browser would count as one...
I do not think this is a good justification... blink have taken over opera, edge, IE, a early version of brave, Samsung and many other smaller browser that is just a shell around blink. so the other browser players basically don't matther at all - that's what you are saying...
I think that: if there is a standard for something in whatwg or tc39, then that should be a justification for adding something into the type def

according to #48001 (comment) it must be two different engines (eg: Blink and Firefox) or Firefox and webkit (safari)

Apparently the requirement is even stricter than that, because #48001 was autoclosed with the suggestion rejected.

For others who run into this, installing @types/wicg-file-system-access will provide proper type support for the File System Access API: https://www.npmjs.com/package/@types/wicg-file-system-access

authors: RyanCavanaugh jgentes jimmywarting wbt