I got a problem on clicking locations. The thing I do is creating a AST from a method with the function:
getMethodASTEclipse(method, model=projectModel);
where method is just an instance of
methods(projectModel);
When I visit that tree and want to get if statements for example I can call
case i: \if(_, _, _):println(i#src);
The source will be printed and I can click on it, eclipse will go to the right class with the right if statement. The form is like this:
|project://MyProject/src/MyClass.java|(2836,143,<104,1>,<109,2>)
But when I get the AST from file with the method:
createAstFromFile(class, true);
and giving a class instaed of a method or even a file I can also visit it and get the same if statement and print it but the form of it is different and I can't click on it. Why not ?
The form of it looks like this:
|java+class:///MyClass/src/MyClass|(17938,1105,<544,4>,<570,5>)
What I also notice is that the offsets are incrementing heavily after each location is printed.
How can I make it clickable to the right location? I think it has to do something with the offset and the form of the location. I tried to use the method:
resolveJava(loc l);
from the Registry class but that didn't work either and tried to look up at declarations for the |loc definition but that wasn't there either.
Thanks in advance.
The reason the locations aren't clickable is because they cannot be resolved. The problem is that createAstFromFile(_,_) was only intended to be used with locations that have either project or file schemes.
For now, you can get the physical location from the declarations annotation in the model and use that to create the AST.
We'll look into making it so that it is possible to use locations with other schemes as well.
Related
I am new to Flutter and Dart. I have implemented list as stack reference for code here. I am calculating path from one node to other in graph. Problem with code is it returns _GrowableList on which is either empty or null but my GetAnswer do returns a correct list(checked while debugging). Why it automatically converts it into growable, How can I have my normal list?
Here is snippet of code where I am passing my graph start node and end node to instance of GetAnswer and storing back result in path variable.
That's the real internal type for the list you created. However, it shouldn't really look like this in the tooltip, this is how it looks for me:
If you can provide code that reproduces showing the tooltip like that, I'd love to take a look. Please open a bug in GitHub.
(It's possible you're on v2.11 of Dart Code - if so, please update to v2.12 and this should be improved)
I'm trying to use the highlighting feature on Webmaster tools. I got done filling it out for my page, but when I go and try to create the page set, it doesn't find any files matching the pattern.
The default pattern that google chose is:
http://www.example.com/*/*/*/*
That's not good enough because that's everything on my site.
What I want is this:
http://www.example.com/Team/Schedule/*/*
It can't find this. The first asterisk is just the id, and the second * is the name associated with that id.
I tried adding this:
http://www.example.com/Team/Schedule/*
It can't find anything here either.
This DOES work
http://www.example.com/Team/*/*/*
So, why doesn't the pattern that I want get recognized? I've even tried copying and pasting in the "Team/Schedule" portion to make I didn't misspell, but that still doesn't work.
Edit:
the "template" path that I used for the highlighting looks like this:
http://www.example.com/Team/Schedule/105/Bears
And similar pages would be:
http://www.example.com/Team/Schedule/52/Vikings
This was a result of Google containing an old cached version of my page structures. I had just recently updated the structure, and Google had not re-crawled to get those changes.
I'm trying geodjango for my pet project and everything looks good with an exception...
In my model I have a field like this:
coordinates= models.PointField(srid=4326,default='POINT(0.0 0.0)')
and my admin extends from admin.OSMGeoAdmin but when I open a new model instance in the admin, I'm not seeing the '0.00,0.00' point selected in the map and if I try to save the document, I'll get 'No geometry value provided'. Like if the admin just Can't put the point in the map.
Also, if I try using the shell, I can save instances w/o problem and get the field with the default value POINT(0.0 0.0).
Am I missing something in the admin?
Thanks for any hint!
I have the same issue.
It's weird. What is getting POSTed makes no sense.
At the point of hitting submit the textarea has the correct geometry value (as I put an onsubmit on the form that outputs me this value).
But what gets submitted is not that value.
So I turned JS off... wow. The correct value is submitted and I am a little happier, but this is not a solution.
But what javascript is doing this I don't know.
I've tried this with Django 1.3 and 1.4.
Have you had any luck?
update. one more 'solution'... override openlayers.html and turn the textarea to a standard text input. wow. works again.
SOLVED!
So mine took some digging... but my admin uses tinymce... Tinymce works on textareas yeah.... well it screwed up the widgets textarea, but ever so silently.
editor_deselector : "vWKTField"
Well, after toying around with open layers.html (THANKS noisyboiler!) I found there is an attribute on the OSMGeoAdmin display_wkt, setting it to True will show the textArea without hacking the template.
For entries with existing points, it contains a value in this format:
SRID=3857;POINT(890338.8453418 -1109499.0330941)
So I just change my Point Field to:
coordinates= models.PointField(srid=4326,default='SRID=3857;POINT(0.0 0.0)')
What I understand from Spherical Mercator is that 4326 is for two-dimensional maps, but seems like google Maps uses 3857 which includes a spherical projection.
Now works!
One of our clients has a website that uses a lot of TreeListEx type field. By default, when an item is selected and moved over to the right side in the TreeListEx editor, the selected element is added to the bottom of the list on the right. The editors for this client would like to have this changed so that the element is added to the top of the list on the right.
For this I tried to look in the Shell folder at Treeview.js and Treelistexeditor.js. But I could not figure where to make the change.
In the TreeListExEditor.js file, look at the scSetMastersType.prototype.moveRight() function. In a loop it calls selected.appendChild(opt) which you may want to change to prepend the option. This would require a bit of JavaScript hackery on your part.
Perhaps start with a typeof(selected) to see what it is. I assume an array. If so, maybe do this:
Reverse the original array
Append your new item at the end of the revered data
Reverse it again to back to normal. Now your new option is at the beginning
Again, because this is JavaScript, there are plenty approaches you can take.
I have found in sfDoctrineApplyPlugin a template called applyAfter.php
that shows a message like "You have registered ok..." after the users apply for an account. It is called from the sfApply/apply action this way: "return 'After';" when the apply form is valid.
What kind of template is that? I never saw that way (return 'After';) of calling a template. Can someone give me info about that?
Second question: I show a layout with a language select when the the
apply form is printed. I wouldn't like to show that language select in
the page that shows the message "You have registered ok...". As the action
is the same in the both pages (sfApply/apply), what should i do to hide
the language select in the verification page?
Javi
The function returns the string 'After' to the caller. The caller always seems to be as follows: $this->widgetSchema->setNameFormat('sfApplyResetRequest[%s]');
So, the string 'After' is being used in conjunction with the setNameFormat function (which is part of the symfony libraries). All it is doing, is setting the 'name' attribute for the form. More information on this function here.
For your second question, you could simply add an IF statement, to check to see if the current route is the one that you do not want to display the language select on. If it isn't, then display the language select.
You can verify the current route with the following code:
sfContext::getInstance()->getRouting()->getCurrentRouteName();