Log On
Embarcadero Home
Watch, Follow, &
Connect with Us
Share This
QualityCentral
Communities
Articles
Blogs
Resources
Downloads
Help
QualityCentral
Delphi-BCB
IDE
Add Component Template
Background compile
Batch file target
Block Completion
Build Tools
Caliber
Class Completion
Class Explorer
Code Browsing
Code Completion
Code Editor
Code Explorer
Code Parameters
Code Templates
Compiler Message Window
Deployment Manager
Dialogs
Direct
Docking
File Browser
File Handling
Form Designer
Help
History View
IDE Insight
Memory Issues
Menu Designer
Menus
Module Manager
Multi-Monitor Support
Object Inspector
Object TreeView
Open Tools API
Packages
Performance
Printing
Project Explorer(old Object Browser)
Project Management
Refactoring
Repository
Save Desktop
Search
Start Page
Starteam
Startup/Shutdown
Structure Pane
System Resources
ToDoList
Tool Palette
Toolbars/Status Line
Translation Tools
Unit Testing
Version Control
VersionInfo
Views
Visual Form Inheritance
Workgroup(PVCS)
You are not logged in.
Help
Print
Public Report
Report From:
Delphi-BCB/IDE/Block Completion
[ Add a report in this area ]
Report #:
97844
Status:
Open
Block completion fails after local procedures
Project:
Delphi
Build #:
15.0.3953.35171
Version:
15.1
Submitted By:
Márton Balassa
Report Type:
Basic functionality failure
Date Reported:
8/19/2011 4:21:44 AM
Severity:
Serious / Highly visible problem
Last Updated:
3/20/2012 2:24:39 AM
Platform:
All platforms
Internal Tracking #:
286750
Resolution:
None
(Resolution Comments)
Resolved in Build:
:
None
Duplicate of:
None
Voting and Rating
Overall Rating:
No Ratings Yet
0.00 out of 5
Total Votes:
None
Description
Using local procedures inside methods make block completion stop working after the end of the local procedure. See steps.
Steps to Reproduce:
1. Create new VCL Forms application.
2. Declare a method in the form:
--------------------------------------------------------------------------------
unit Main;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs;
type
TMainForm = class(TForm)
private
{ Private declarations }
public
procedure Batman;
end;
var
MainForm: TMainForm;
implementation
{$R *.dfm}
{ TMainForm }
procedure TMainForm.Batman;
procedure Robin;
begin
end;
begin
try|
end;
end.
--------------------------------------------------------------------------------
3. Declare a local procedure inside the method.
4. Place the cursor after 'try' (marked by the pipe character) and press ENTER.
Expected: the try-finally-end block is automatically created.
Actual: nothing happens, and block completion doesn't work for the rest of the method.
Block completion resumes working instantly if you remove the local procedure.
Workarounds
Avoid using local procedures when encountering this problem. In some cases, block completion will not break due to local procedures, but the above steps can reproduce the problem.
Attachment
BlockFail2.zip
Comments
Márton Balassa at 10/13/2011 2:49:29 AM
-
In many cases, declaring anonymous methods break block completion as well, but I can't provide a simple test case yet.
Márton Balassa at 10/14/2011 4:53:18 AM
-
Update! I've assembled a demo showing even weirder editor behavior. See attachment (BlockFail2.zip).
Note that this is a minimal test case. In our projects, we managed to create anonymous methods that screw up block completion so badly that after pressing enter ANYWHERE in the file, the editor inserts a closing for some previous block, producing code like this:
begin
// even Chuck Norris can't press enter anywhere near without inserting another 'end' line.
end;
end;
end;
end;
All our source files compile and run perfectly of course, this is merely an editor bug.
One more comment for Embarcadero: beacuse these errors, our productivity has dropped seriously after migrating our projects from D2007 to XE. We are forced to continous refactoring and anti-optimization. This not only takes time for developers, but also makes our software slower and more complicated, since we can't use anonymous methods and/or local procedures on many occasions. Will you consider this a show stopper? Will you fix this bug in XE?
View Your Reports
Search
Server Response from: ETNACODE01
Developer Tools
Blackfish SQL
C++Builder
Delphi
FireMonkey
Prism
InterBase
JBuilder
J Optimizer
HTML5 Builder
3rdRail & TurboRuby
Database Tools
Change Manager
DBArtisan
DB Optimizer
ER/Studio
Performance Center
Rapid SQL
Technical Articles
Tutorials
White Papers
Press Releases
Newsletters
Add Content (GetPublished)
Audio
Audio & Video
Video
Bugs & Suggestions (QualityCentral)
Discussion Forums
Examples (CodeCentral)
Tags
Technology Partners
Downloads
Free Trials
Registered User Downloads
Beta Programs
Add Content (GetPublished)
Articles
Blogs
Bugs & Suggestions (QualityCentral)
Discussion Forums
Examples (CodeCentral)
Member Services
About
Connect with Us