You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
typeTest='test';// Please, try to complete the test by Ctrl-space and then selecting suggestionconsttest: Test='t';//This works fineconsttest2: Test='t; // This comment definitely should not get deleted on completion, because it could be important code, but it doesconst test3: Test = "t; // This comment definitely should not get deleted on completion, because it could be important code, but it does// Refactoring example where this behavior is bad. Try selecting suggestion from "t" to "test"const test4: { prop1: number, prop2: number } = {prop1: 5, prop2: 2 };const test5: {prop0: Test, prop1: number, prop2: number, } = { prop0: 't,prop1: 5,prop2: 2};// Completion in 5.5 results to consttest6: {prop0: Test,prop1: number,prop2: number,}={prop0: 'test// Completion in 5.4.5 results to const test7: {prop0: Test, prop1: number, prop2: number, } = { prop0: 'test,prop1: 5,prop2: 2};
π Actual behavior
When trying to complete "t" to "test" in the code for variables test2, test3, everything up to the end of line gets deleted.
This is especially bad when trying to add new string properties to existing objects, as can be seen by example refactoring of test4 to test5 variable. Where poor result of selected suggestion can be seen in test6 variable and good behavior of previous TS versions in test7 variable.
π Expected behavior
When editing new string, typescript should insert suggestions, not replace content. Previous versions behavior seems perfect to me.
Additional information about the issue
EDIT: updated example, one of the previous examples didn't behave very well even in previous versions. Added demonstration of previous good behavior.
No response
The text was updated successfully, but these errors were encountered:
π Search Terms
completion autocompletion string
π Version & Regression Information
β― Playground Link
https://www.typescriptlang.org/play/?ts=5.5.0-beta#code/C4TwDgpgBAKhDOwoF4oHJgOGg3AKAHoCoAFAGwgEN4IAaKYAJxAYHsoBjVgWzAswYALaJkRQARiwDCTMgFp4YSh2iUAdgBMhENVBoUOwAJZqA5noCup01iOs1eLmrGjgALlhYU6bDihEYQSN4KAB3VkYAaxCAMxMIR3sXLAAmDzgxVAw-IlggkI0IOLUjTDIWeEFWCzItNVYkGyRC-ggte04ePghje3pxCA5KCxooUs6arQGx3gjgdSQuQv6LJHGNVgRE5yRXAGZ0r1QAImAc4kDgqELi0ohyvSrJqHrGnuv7nraoDq5efjsan6g2Go3GXGe0yMs0Y8zUi1YywkqzGzU28DwhGIACUispgBETOYIAAPSj-aChYSMET5CQQQSUABudkYYxC4koGgAdLBmHpPoYiZZrLYOjFGDwoKdjmxpa5jttkogACweADeUDAkrAAEYPGoLNwBox6NrWGA0i8jSaoABfbzq816jwAVjNOqtKXt+CcyuAro1zoADIdEB6LfrrcaIKatZ6DTbY-R7Y74xbQz4oLRnVH3enLR5vXb8LkpF0AR0TFBXdzXVAafAasAQgSoErdlgAGxBnWZjLACMu6MmodWw0xuOp1CakMeDBYLFQcsU3q6au1lV1hsIZut9gdhhYADsvYzYcHBajE9HBfHSanDpnBczC7EOZ1ebHRZ9QA
π» Code
π Actual behavior
When trying to complete "t" to "test" in the code for variables test2, test3, everything up to the end of line gets deleted.
This is especially bad when trying to add new string properties to existing objects, as can be seen by example refactoring of test4 to test5 variable. Where poor result of selected suggestion can be seen in test6 variable and good behavior of previous TS versions in test7 variable.
π Expected behavior
When editing new string, typescript should insert suggestions, not replace content. Previous versions behavior seems perfect to me.
Additional information about the issue
EDIT: updated example, one of the previous examples didn't behave very well even in previous versions. Added demonstration of previous good behavior.
No response
The text was updated successfully, but these errors were encountered: