Comments (6)
Thanks for the quick response @mcartoixa , I'm attaching a comparison (using your code sample) between the new language grammar rules (left) and the ones we currently ship with (right). I'm using 'Dark +' theme on the screenshots but similar results can be seen with any theme since the new tokens follow TextMate's guidelines. This are the first set of language grammar changes we'll be shipping since we feel they already provide a better experience. They will be part of this week's v42.16.0 release (May 17th).
Thanks for your feedback and let us know what you think once you try out the changes.
from salesforcedx-vscode.
@mcartoixa - Thanks for reporting this. We are aware of the current limitations and are planning to address parts of them. The syntax highlighter that we are using (https://github.com/forcedotcom/salesforcedx-vscode/blob/develop/packages/salesforcedx-vscode-apex/syntaxes/apex.tmLanguage) is based on some old TextMate grammar (it's a modified copy of https://github.com/superfell/ApexMate/blob/master/plugin/Syntaxes/Apex.tmLanguage).
@ntotten - Per our discussion yesterday.
from salesforcedx-vscode.
Tracked internally as W-4800460
from salesforcedx-vscode.
Hi @mcartoixa, I'm working on fixing the tokenization issues you mentioned, I'm running some tests and would like to test with the code you used. Could you share a code sample so I can test against it?
from salesforcedx-vscode.
Found it 😉
/**
* Used to read a delimited file.
*/
public class SSSCsvReader {
private String delim = ',';
// the input data
private String[] buffer;
public SSSCsvReader(String data){
this.buffer = data.split('\n');
}
public SSSCsvReader(String data, String delim){
this.buffer = data.split('\n');
this.delim = delim;
}
/**
* Read and parse next available line. Return null if end of stream.
*/
public String[] readLine(){
if(buffer.size() == 0)
return null;
String line = this.buffer.remove(0);
String[] parts = new String[] {};
while(line != ''){
Integer next = 0;
if(line.startsWith('"')){
line = line.substring(1); // strip initial
Integer quoteIndex = findQuote(line, 0);
while(quoteIndex == -1){
if(buffer.size() == 0){
// EOT!
quoteIndex = line.length();
} else {
// grab the next line
Integer skip = line.length();
line += '\n' + this.buffer.remove(0);
quoteIndex = findQuote(line, skip);
}
}
// advance to comma
next = quoteIndex + 1;
parts.add(line.substring(0, quoteIndex).replace('""', '"'));
} else {
next = line.indexOf(this.delim, next);
if(next == -1)
next = line.length();
// NB in Substring, "endindex" is the index of the character AFTER the last index to get
parts.add(line.substring(0, next));
}
if(next == line.length() - 1)
// case of a terminating comma.
parts.add('');
line = next < line.length() ? line.substring(next+1) : '';
}
if(parts.size() == 0)
// empty string - we still want to return something...
parts.add('');
return parts;
}
static private Pattern quotePattern = Pattern.compile('(?<!")"(?!")');
/**
* Find next quote in the line
*/
private Integer findQuote(String line, Integer skip){
Matcher m = quotePattern.matcher(line);
m.region(skip, m.regionEnd());
if(!m.find())
return -1;
return m.start();
}
}
from salesforcedx-vscode.
We are closing this as part of #415
@mcartoixa - If you see any other issues, please open a new issue for this. Thanks again for reporting this.
from salesforcedx-vscode.
Related Issues (20)
- I downgraded my salesforce CLI, and it is still taking 30 minutes (and counting) to run apex tests. I have 3 methods in this test class. It should take a minute to run, tops. HOT 22
- Display a Notification when a new sfdx version is available HOT 1
- not getting activated HOT 3
- It is taking 45 minutes to run a diff file against an org. I downgraded as above, to v58.7.1 and CLI 2.21.7. It is still taking 45 minutes to run a diff file or a retrieve against an org, where previously it woul only take a few seconds or less than a minute. HOT 19
- An unsupported Java version was detected. Java 17. Oracle OpenJDK HOT 12
- Retrive taking too long HOT 3
- Very slow sfdx retrieve HOT 5
- Cannot read properties of undefined (reading 'type') HOT 5
- Salesforce CLI supports Business Rules Expression Sets (e.g. ExpressionSetObjectAlias), but it is not supported by Salesforce Extension Pack in VSC HOT 1
- 22:40:37.239 sfdx org:login:web --alias dev --instance-url https://login.salesforce.com --set-default ended with exit code 1 HOT 3
- Cannot deploy anything using right click on file - shows "Could not find 6b630..." error HOT 2
- SFDX: Authorize an Org failed to run HOT 13
- that you tried to deploy or retrieve isn't in a package directory that's specified in your sfdx-project.json file. Add this location to your "packageDirectories" value, or deploy or retrieve a different file or directory. For details about sfdx-project.json, see: HOT 1
- Cannot get html lightning language support for aura HOT 25
- After updating SF extension pack in VSCode, everything is broken. HOT 21
- sf apex get tests hangs for two minutes HOT 9
- SFDX Retrieve is taking forever for LWC and Apex HOT 5
- Null coalesce operator HOT 4
- Not able to change between Multiple Orgs. HOT 2
- Enable more granularity on Org Browser and Custom Objects in Source Format.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from salesforcedx-vscode.