Page 1 of 1

Error visual studio + tpl + smarty

PostPosted: March 22nd, 2018, 9:51 am
by victor
Hello Devsense,

I am writing to enquire about a problem with the PHP extension for Visual studio.

I'm using Visual Studio Community 2017, updated to the latest version with Smarty, PHP Template Engine. I'm using the templates with extension .tpl

My problem is when a.tpl file is very big, we are talking about 800 lines in the same file. Editing is tremendously slow, every change or command that I write takes a long of time to be completed. When it detects the opening bracket "{", stop and I must wait around 2 or 3 seconds. If I want to write a word, for example: console(), it takes about 15 seconds to write the whole word.

I Can't Work Like This. :(

On the other hand, editing small .tpl files, I have no problem with that. Not even with huge .php files, or any another extension.

I don't have any Smarty extension installed in Visual Studio. Can I fix this problem? With any change in the extension or in Visual Studio?

Thank you in advance,

error vs:

Code: Select all
    <time>2018/03/22 09:36:39.179</time>
    <source>Editor or Editor Extension</source>
    <description>System.ArgumentException: The specified SnapshotPoint or SnapshotSpan  is on a different ITextSnapshot than this SnapshotSpan.&#x000D;&#x000A;   en Microsoft.VisualStudio.Text.SnapshotSpan.EnsureSnapshot(ITextSnapshot requestedSnapshot)&#x000D;&#x000A;   en Microsoft.VisualStudio.Text.SnapshotSpan.IntersectsWith(SnapshotSpan snapshotSpan)&#x000D;&#x000A;   en Devsense.VisualStudio.Smarty.Errors.SmartySyntaxReporter.&lt;&gt;c__DisplayClass0_0.&lt;GetErrors&gt;b__0(ITagSpan`1 e)&#x000D;&#x000A;   en System.Linq.Enumerable.WhereListIterator`1.MoveNext()&#x000D;&#x000A;   en System.Collections.Generic.List`1.InsertRange(Int32 index, IEnumerable`1 collection)&#x000D;&#x000A;   en Devsense.VisualStudio.Smarty.Errors.SmartySyntaxReporter.GetTags(NormalizedSnapshotSpanCollection spans)&#x000D;&#x000A;   en Microsoft.VisualStudio.Text.Tagging.Implementation.TagAggregator`1.&lt;GetTagsForBuffer&gt;d__39.MoveNext()&#x000D;&#x000A;--- Fin del seguimiento de la pila de la ubicaci&#x00F3;n anterior donde se produjo la excepci&#x00F3;n ---&#x000D;&#x000A;   en Microsoft.VisualStudio.Telemetry.WindowsErrorReporting.WatsonReport.GetClrWatsonExceptionInfo(Exception exceptionObject)</description>

Re: Error visual studio + tpl + smarty

PostPosted: March 23rd, 2018, 9:53 am
by Michal Brabec
Hi Victor,
thank you for reporting the issue. We are sorry for your inconvenience.
We will examine the performance of Smarty and let you know once we have a better idea what can be improved.
Thank you for patience,

Re: Error visual studio + tpl + smarty

PostPosted: March 23rd, 2018, 12:17 pm
by Michal Brabec
Hi Victor,
we have improved Smarty performance so it should not be as slow when working with large templates.
The change will be release in the next update.
We will further enhance Smarty performance in the future, but this fix should help to make your work less tedious in the mean time.
Let us know if it helped.
Best regards,